Version 8

    How to upload third party artifacts (jars) to the jboss maven repository.


    During the development process, you're project may depend on external projects: some that exist in the local jboss repository, and others that exist in the central maven repository.  Before you release your application, you should make sure that all your project dependencies are available in the jboss repository.  This ensures that your release can be rebuilt from source at a later time if needed.


    Here are some various situations that can occur, and how you can decide which repository to upload to, and how to upload to that repository.


    1. Deploying a jar to the JBoss repository.


    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 MavenPomTemplate.


    The next step is to verify your MavenSettings.  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: -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.


    2. Copying several dependencies that are available in the central maven repository, but not in the jboss repository.


    The maven dependency plugin can be used to copy a projects dependencies from the central maven repository to a location on your local file system.

    Next, you will need to copy your project's dependencies to this location.  From your project root:

    mvn dependency:copy-dependencies -Dmdep.copyPom=true


    Now the dependencies from your project have been downloaded and copied to target/dependencies.  Follow step 1 to for each of the dependencies that need to be deployed to the jboss repository.


    3. Uploading to the snapshot repository.


    If you are building from source, you may want to upload to the MavenSnapshotRepository instead of the releases repository.  The JBoss snapshot repository currently uses the webdav protocol to upload files.


    mvn deploy:deploy-file -Durl=file:///mypath/ -DartifactId=some-artifact -Dversion=1.0-SNAPSHOT -DgeneratePom=true