Maven Release Repository

    This page contains out of date information.

     

    Please refer to one of the following pages for more information about the JBoss.org Maven repositories

     

    Maven Repository

     

    Maven Getting Started - Users

     

    Maven Getting Started - Developers

     


     

    The maven releases repository contains jboss project artifacts (jars, zips, poms, etc) that have been tagged and released.  It also contains thirdparty artifacts that are used in jboss builds.


    This repository is located at http://repository.jboss.org/maven2

     

    Uploading artifacts to the repository

     

    The maven repository is backed by an svn repository is located at the following URL.

     

    https://svn.jboss.org/repos/repository.jboss.org/maven2

     

    Uploading with Wagon-SCM

     

    The prefered method for uploading artifacts to the repository is to use Maven Wagon SCM.  This allows Maven to deploy directly to the backing svn repository.

     

    Maven does not provide the necessary libraries to deploy to svn by default.  So the first step to using this system is to make sure that the appropriate extensions are loaded.  Your POM should include something like this.

     

    <project>
      ...
      <build>
        <!-- To allow to deploy releases in SVN -->
        <extensions>
          <extension>
            <groupId>org.apache.maven.wagon</groupId>
            <artifactId>wagon-scm</artifactId>
            <version>1.0-beta-6</version>
          </extension>
          <extension>
            <groupId>org.apache.maven.scm</groupId>
            <artifactId>maven-scm-manager-plexus</artifactId>
            <version>1.0</version>
          </extension>
          <extension>
            <groupId>org.apache.maven.scm</groupId>
            <artifactId>maven-scm-provider-svnexe</artifactId>
            <version>1.0</version>
          </extension>
        </extensions>
        ...
      </build>
      ...
    </project>
    
    
    
    

     

    Next the distributionManagement section of the POM must be configured with the correct deployment URL.

     

    <project>
      ...
      <distributionManagement>
        <repository>
          <id>jboss-releases</id>
          <name>JBoss Release Repository</name>
          <url>scm:svn:https://svn.jboss.org/repos/repository.jboss.org/maven2</url>
        </repository>
        ...
      </distributionManagement>
      ...
    </project>
    
    
    

     

    The build extension and distributionManagement configuration is included in the jboss-parent POM version 5-beta-4 or above.  This allows your project POM to automatically inherit the above configuration.

     

    <project>
      ...
      <parent>
        <groupId>org.jboss</groupId>
        <artifactId>jboss-parent</artifactId>
        <version>5-beta-4</version>
      </parent>
      ...
    </project>
    

     

    The next step is to verify that Maven has access to your SVN credentials to commit the new files to the repository.  Your maven settings file (~/.m2/settings.xml) should include the correct server configuration.

     

     <server>
       <id>jboss-releases</id>
       <username>my-jboss.org-username</username>
       <password>password</password>
     </server>
    

     

    Once this configuration is complete you can deploy the project by running the maven deploy command.

     

    mvn deploy
    

     

    After the files are deployed it will take some time for the files to appear in the public repository.  Please allow up to 1 hour for the public repository to be updated with the changes.

     

    The deployment can also be done as part of the Maven release process.

     

    Note: this method requires that the command line svn client is installed and available to Maven (via the system PATH).

     

    Manually Committing Files

     

    Another option for deploying project files is to checkout all or part of the svn repository, use the standard file system deployment protocol, and then commit the new files to SVN using a command line or GUI client svn application.

     

    Checking out the entire repository can be very time consuming because the repository contains a large amount of data.  So in most cases it is easier to check out only the relevant projects.

     

    First, checkout only the root folder.

    svn co -N https://svn.jboss.org/repository.jboss.org/maven2 /path/to/checkout

     

    Then you can add one folder at a time as you traverse the branch of the tree you are interested in a similar fashion.

     

    cd /path/to/checkout
    svn update -N org
    cd org
    svn update -N jboss

     

    At any point you can leave off the -N flag to checkout all the files in a branch.

     

    Another option is to use svn mkdir:

     

    svn mkdir https://svn.jboss.org/repos/repository.jboss.org/maven2/org/newgroup
    

     

    Note that this command brings up an editor in which you have to provide commit log entry.

     

    After that, you can use one of aforementioned means to check out this new dir.

     

    Once you have the required directory structure in place, you will need to configure you POM's distributionManagement section to deploy to the root of the checked out repository.

     

      <distributionManagement>
        <repository>
          <id>jboss-releases</id>
          <url>file:///path/to/repo/checkout</url>
        </repository>
      </distributionManagement>
    

     

    You can also deploy to the repository without changing your POM files using the option altDeploymentRepository of the maven deploy plugin.

     

    mvn deploy -DaltDeploymentRepository=jboss-releases::default::file:///path/to/repo/checkout
    

     

    After running mvn deploy or maven release:perform, the files will be copied to the local repository checkout.  When this is finished cd into the root project directory in the repository and commit the files.

     

    cd /path/to/repo/checkout/org/foo
    svn ci . -m "Release project foo version x.y.z.Beta1"
    

     

    Uploading Via Webdav

     

    This method is not recommended because it causes files to be uploaded with incorrect MIME types.  This method may be disabled at some point in the future.

     

    dav:https://svn.jboss.org/repos/repository.jboss.org/maven2

     

    Uploading With Wagon-SVN

     

    This method is not recommended because it causes files to be uploaded with incorrect MIME types.

     

    More information can be found on the wagon svn site.

     

    Deploying non-maven based projects

     

    In this case the maven deploy plugin can be used to deploy a jar (or other artifact) and it's associated pom file.  The first step is to create a valid pom file, or edit an existing pom file to meet the JBoss requirements.  This means that the pom should be valid and include appropriate license information.  If you need to create the pom file from scratch, you can use a Template.

     

    The next step is to verify your Maven Settings.  Make sure that you have a <server> tag which contains your svn username and password.  The value of the <id> field is passed as a parameter to the maven deploy plugin to enable the plugin to write to svn.

     

    mvn deploy:deploy-file -Dfile=myfile.jar -DpomFile=myfile-pom.xml -Durl=dav:https://svn.jboss.org/repos/repository.jboss.org/maven2 -DrepositoryId=jboss-releases

     

    Note: You should not use the automatic pom generation capability of the deploy plugin because the generated pom does not include the license information that is needed for many JBoss builds.

     

    Deploying buildmagic based projects

     

    The maven-buildmagic-thirdparty-plugin can be used to read a component-info.xml file and deploy the project artifacts to a maven repository.  Here is an example of how to use it:

     

    mvn org.jboss.maven.plugins:maven-buildmagic-thirdparty-plugin:maven-deploy -Durl=file:///path/to/local/repo/checkout -DcomponentDir=path/to/directory/containing/component-info/file

    Adding jars manually

     

    Jars can be manually added to the repository as long as you are careful that the path matches the groupId and artifactId in the POM.  If you add files manually, you will also need to generate the appropriate checksums. How to let Maven do this for you is described here.

     

    The following bash script can be used on Linux to generate the checksums.

     

    #!/bin/bash
    # Proper header for a Bash script
    
    if [ -n "$1" ]
    then
      root_dir=$1
    else
      root_dir=.
    fi
    
    echo $root_dir
    
    find $root_dir -name '*.pom' | while read FILE
    do
      echo $FILE
      checksum=`md5sum $FILE`
      echo -n ${checksum%% *} > $FILE.md5
      checksum=`sha1sum $FILE`
      echo -n ${checksum%% *} > $FILE.sha1
    done
    
    find $root_dir -name '*.jar' | while read FILE
    do
      echo $FILE
      checksum=`md5sum $FILE`
      echo -n ${checksum%% *} > $FILE.md5
      checksum=`sha1sum $FILE`
      echo -n ${checksum%% *} > $FILE.sha1
    done
    

    The following batch file can be used on Windows (only supports generating checksums for one file at a time):

    @echo off
    ::
    :: A simple script that generates Apache-style md5 and sha1 checksum
    :: files for the specified files.
    ::
    :: NOTE: This batch file requires md5sum, sha1sum, and gawk to be in the
    :: PATH. Win32 binaries can be obtained from
    :: http://gnuwin32.sourceforge.net/.
    ::
    :: $Id: gensums.cmd 4432 2007-04-23 20:15:41Z ispringer $
    ::
    :loop
    if "%1"=="" goto done
    
    echo Processing %1...
    echo Writing MD5 sum to %1.md5...
    md5sum %1 | gawk "{print $1}" >%1.md5
    echo Writing SHA1 sum to %1.sha1...
    sha1sum %1 | gawk "{print $1}" >%1.sha1
    
    shift
    goto loop
       
    :done

     

    Referenced by: