YetAnotherSimpleMavenRepo (or YASMR) is a very simple (less than 200 lines!) Maven repository server.
YASMR was created because sometimes you just want a very easy and quick to use Maven repository, instead of going through hoops and complex setup just to get a small repository server up and running.
Do I recommend using YASMR in production? Yeah... probably not. If you need a Maven repository that a lot of people can use I recommend using a battle-tested repository server like Sonatype Nexus!
- Easy to use, you just need Java installed!
- Supports basic authentication + whitelisted groups for users!
- Allows hosting a basic
index.html
for your repository main page!
- PowerShell (Windows) or Terminal (Linux).
β οΈ While Windows' command prompt may work, it is better to use PowerShell!
- You need to have the Java Development Kit installed on your machine. The minimum required version to compile and run YASMR is JDK 11.
- You need to have Git installed on your machine.
- Check if your machine has the
JAVA_HOME
property set correctly, newer JDK versions downloaded from AdoptOpenJDK may already have the variable set correctly. You can check if the variable is set by usingecho $env:JAVA_HOME
in PowerShell. - If you want to help to develop YASMR, or if you only want a good Kotlin IDE, then download JetBrains IntelliJ IDEA! The community edition is enough, so you don't need to be like "oh my god I need to pay for it". π
- Clone the repository with git:
git clone https://github.com/PerfectDreams/YetAnotherSimpleMavenRepo.git
- Go inside the source code folder and open PowerShell or the terminal inside of it.
- Build YASMR with Gradle:
./gradlew build
π‘ If you have Gradle installed on your computer, you can use
gradle build
instead of./gradlew build
β οΈ If Gradle complains that thereadAllBytes()
method is missing, then you are using an outdated method (pre-JDK 9) version, please update your JDK! We are in${currentYear}
, get off your dinosaur and get on the latest JDK from AdoptOpenJDK train, choo choo! π
- If the build is successful, then congratulations π! You have successfully compiled YASMR!
- The final artifacts will be inside of the
build/libs/*.jar
folder, YASMR's dependencies will be inside of thelibs/
folder.
You did it! Now... why not run YASMR? π
- You will need the same prerequisites from the Compiling YASMR section, please check that section first.
- Create a empty folder somewhere in your OS, why an empty folder? Just to keep things tidy! :3
YASMR's JAR: /build/libs/
(get the Fat JAR version!)
YASMR's Libraries: libs/
You can find precompiled artifacts on the "Release" section!
You will need to get YASMR
and YASMR (Libs)
- Copy the
yet-another-simple-maven-repository-*-fat.jar
to your created folder. - Copy the
libs
folder to your created folder. - If you did everything right, you should have in the root folder...
-
- A file named
yet-another-simple-maven-repository-*.jar
, this is YASMR's executable.
- A file named
-
- A folder named
libs
containing all YASMR's dependencies.
- A folder named
- Run YASMR with
java -jar yet-another-simple-maven-server-*-fat.jar
(replace the JAR name with the JAR in your folder) - Update the configurations with your own values.
- Run YASMR again with
java -jar yet-another-simple-maven-server-*-fat.jar
(replace the JAR name with the JAR in your folder) - If everything went well, your very own YASMR instance should be up and running! Congratulations! π
- (Optional) Don't forget to port forward your
plugins {
kotlin("jvm") version "1.3.72"
`maven-publish`
}
...
publishing {
repositories {
maven {
name = "YourRepoNameHere"
url = uri("http://repo.name.here.com/")
credentials {
username = "loritta"
password = "lori_is_so_cute"
}
}
}
publications {
register("YourRepoNameHere", MavenPublication::class.java) {
from(components["java"])
}
}
}