(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/
worked the first time, but there was a mistake in my release, and I re-released the same version. Now the pom fill that uses/downloads this repository no longer finds it. (although it worked fine the first time).