Reposilite 3.x — Setup your own Maven repository manager in 5 minutes

dzikoysk
3 min readOct 7, 2022
Reposilite 3.x

This article was written, because we’ve just released a new major version of Reposilite with a bunch of new features!

Reposilite is already widely used by various projects on GitHub, if you’re not familiar with this project, visit https://reposilite.com to explore all possibilities.

About

Maven ecosystem is a part of every Java developer’s life. It doesn’t matter if you use Maven or Gradle with Java, Kotlin or Scala (etc.), artifacts are exchanged via the same protocol — Maven protocol ✨.

Reposilite is simple, performant, extensible and scalable self-hosted solution that replaces heavy managers like Nexus/Artifactory, so it’s pretty good for hobbyists and open source enjoyers.

Installation

First of all, download the latest version of Reposilite from GitHub:

To launch Reposilite, just run the JAR file:

$ java -Xmx32M -jar reposilite.jar --token manager:passwd
  • To limit memory to 32MB of RAM, we’ve used -Xmx32M flag, but of course it’s optional and depends on your use-case.
  • In this article we’ll use --token flag to generate temporary access token for setup purposes. It’s not required for manual setup, but it’ll be very helpful for users that decided to use Docker images, because it’s the only way to generate your first access token [see more: Temporary tokens]

By default, your Reposilite instance should start at 0.0.0.0:8080, so just visit: http://localhost:8080/. You should see the new dashboard:

http://localhost:8080/

Sign in with your temporary credentials, where Name is manager and Secret is passwd. Because Reposilite 3.x is still CLI oriented application, go to Console tab and you should see interactive shell. To generate persistent token called admin that will be stored in database, type:

token-generate admin m

The m in this command refers to management permission. To learn more about tokens in general, visit official guide:

You should see this output:

Generated new access token for admin with 'm' permissions. Secret:
CCzfbftGnwBaZpZvK4enxqq8

This long phrase in the second line is automatically generated secure password. We can now remove temporary manager token as it’s not longer needed. Stop your instance using stop command and launch it once again without --token flag.

That’s pretty much all, your instance is ready to use. Let’s say we’d like to use it one of your Maven project. First of all, go to ~/.m2/settings.xml file and add your credentials:

<settings>
<servers>
<server>
<!-- Id has to match the id provided in pom.xml -->
<id>my-repository</id>
<username>admin</username>
<password>CCzfbftGnwBaZpZvK4enxqq80</password>
</server>
</servers>
</settings>

Now go to your Maven project and declare distribution management in pom.xml file:

<distributionManagement>
<repository>
<id>my-repository</id>
<url>http://localhost:8080/releases</url>
</repository>
</distributionManagement>

If you’re ready to publish your project, just use mvn deploy goal and if your setup is correct, deployed project should be available in the releases repository!

Extra

In case of any issues, missing features or if you’d like to just ask about some other related stuff, feel free to create new issue in Reposilite repository or join us on Discord 💜

--

--