(note: replace ORGANIZATION
and PROJECT
)
git clone git clone [email protected]:ORGANIZATION/PROJECT.git my-repository
cd my-repository
git branch repository
git checkout repository
rm -rf file1 file2 file3 .. etc
(note: replace YOUR_GROUP
, YOUR_ARTIFACT
, YOUR_VERSION
and YOUR_JAR_FILE
)
mvn install:install-file -DgroupId=YOUR_GROUP -DartifactId=YOUR_ARTIFACT -Dversion=YOUR_VERSION -Dfile=YOUR_JAR_FILE -Dpackaging=jar -DgeneratePom=true -DlocalRepositoryPath=. -DcreateChecksum=true
YOUR_JAR_FILE
should point to an existent jar file, this is why it's best to create your repository branch in a different folder, so you can reference the existing jar in /your/project/path/target/artifact-x.y.z.jar
git add -A . && git commit -m "released version X.Y.Z"
git push origin repository
The repository url you just created is https://raw.github.com/YOUR_ORGANIZATION/YOUR_ARTIFACT/repository/
The solution described above doesn't work anymore. There is another simple solution to use the GitHub Actions:
If you're looking to convert a regular GitHub repository into a functional Maven repository to host
.aar
,.jar
, or other Java artifacts, this guide will walk you through the process using two simple GitHub Actions:.aar
,.jar
,-sources.jar
) to your Maven repoSee here for more details.