Accueil‎ > ‎

Host Maven Repository for Free

posted 27 Nov 2018, 07:55 by Christophe Noël   [ updated 29 Nov 2018, 02:10 ]
Actually, there is no (really) free Maven repository hosting. But it does not mean you have to pay for it !

Indeed, the solution comes from a very simple idea:
1. Build a maven repository locally
2. Copy to the file to a free hosting solution (Dropbox, Gitlab, Github, etc.)

Concretely, you build using:


Then you need to copy/sync/push the directory to your hosting solution.

Once you understood this approach, we may go further in automation using GitHub using the Maven Plugin site-maven-plugin to publish the Maven site on build.

1. Let's build automatically the local repository on deploy

                <configuration>            <altDeploymentRepository>internal.repo::default::file://C:/any/location</altDeploymentRepository>

2. Good, then here is how you publish automaticall to Github.

                    <message>Maven artifacts for ${project.version}</message> 
                    <noJekyll>true</noJekyll>                                  <!-- disable webpage processing -->
                    <outputDirectory>C:/any/location</outputDirectory> <!-- matches distribution management repository url above -->
                    <branch>refs/heads/master</branch>                       <!-- remote branch name -->
                    <repositoryName>maven-public-libs</repositoryName>      <!-- github repo name -->
                    <repositoryOwner>xxx</repositoryOwner>    <!-- github username  -->
                    <!-- run site-maven-plugin's 'site' target as part of the build's normal 'deploy' phase -->