Last active
June 18, 2020 12:10
-
-
Save nisrulz/efb1654eaeb8930591c6 to your computer and use it in GitHub Desktop.
Creating a maven repository
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Create Maven Repository | |
#Create a directory named mavenrepo | |
mkdir mavenrepo | |
#Move into the dir | |
cd mavenrepo | |
#Initialise with git | |
git init | |
#Add remote repo | |
git remote add origin git@github.com:<username>/<mavenrepo>.git | |
#Create releases and snapshots dir | |
mkdir releases snapshots | |
#Create README.md under each dir | |
touch releases/README.md | |
touch snapshots/README.md | |
#Git add all files | |
git add . | |
#Git commit with a msg | |
git commit -m "Initial Setup" | |
#Push to remote | |
git push origin master | |
### Generating maven artifacts | |
mvn clean org.apache.maven.plugins:maven-install-plugin:2.5.2:install-file -DgroupId=com.company.id -DartifactId=artificat-id -Dversion=1.0.0 -DpomFile=pom.xml -Dpackaging=aar -Dfile=artifact.aar -DlocalRepositoryPath=./mavenrepo/releases/aar -DgeneratePom=true -DcreateChecksum=true | |
### Adding and pushing artifacts to remote maven repo | |
git add . | |
git commit -m "<artifact> v1.0.0 added" | |
git push origin master |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
How do I generate the
pom
file? The default one generated in./gradlew assembleRelease
isn't accepted bymvn