Forked from cleberjamaral/how-to-use-github-as-maven-repo.md
Created
February 22, 2022 15:57
-
-
Save ThatOneTallKid/727a605d1e204aa4180d4570ffb6b901 to your computer and use it in GitHub Desktop.
Revisions
-
cleberjamaral revised this gist
Oct 7, 2019 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -40,7 +40,6 @@ In this how-to it is being explained how to create a maven repository on github If you already have a repository using this way explained above, you can use the following commands to setup another machine in order to update your repository. 1. Clone your maven2 branch to a local folder which name is followed by "-maven2" (change GROUP-NAME and PROJECT-NAME) ```git clone https://github.com/GROUP-NAME/PROJECT-NAME.git PROJECT-NAME-maven2 --branch maven2``` 1. To update your maven2 repo, follow steps from run mvn install for jar creation -
cleberjamaral revised this gist
Oct 7, 2019 . 1 changed file with 1 addition and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -32,9 +32,7 @@ In this how-to it is being explained how to create a maven repository on github ```git push origin maven2``` 1. On gradle you can add this repository on 'repositories' ```maven { url "https://github.com/ORGANIZATION-NAME/PROJECT-NAME/raw/maven2" }``` * *1 Your PATH-TO-THE-JAR will be something like: ```../PROJECT-NAME/build/libs/ARTIFACT-NAME-ARTIFACT-VERSION.jar```. Use ```-DpomFile=PATH-TO-EXISTING-POM``` instead of ```-DgeneratePom=true``` if you already have a POM. -
cleberjamaral revised this gist
Oct 7, 2019 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -19,7 +19,7 @@ In this how-to it is being explained how to create a maven repository on github ```rm -R ALL-PROJECT-SUB-FOLDERS``` ```rm ALL-PROJECT-FILES``` 1. run mvn install for jar creation (change GROUP, ARTIFACT-NAME, ARTIFACT-VERSION, PATH-TO-THE-JAR and PATH-TO-EXISTING-POM). See *1 for details. ```mvn install:install-file -DgroupId=GROUP -DartifactId=ARTIFACT-NAME -Dversion=ARTIFACT-VERSION -Dfile=PATH-TO-THE-JAR -Dpackaging=jar -DlocalRepositoryPath=. -DcreateChecksum=true -DgeneratePom=true``` 1. Add all files to be commited @@ -36,7 +36,7 @@ In this how-to it is being explained how to create a maven repository on github maven { url "https://github.com/ORGANIZATION-NAME/PROJECT-NAME/raw/maven2" } ``` * *1 Your PATH-TO-THE-JAR will be something like: ```../PROJECT-NAME/build/libs/ARTIFACT-NAME-ARTIFACT-VERSION.jar```. Use ```-DpomFile=PATH-TO-EXISTING-POM``` instead of ```-DgeneratePom=true``` if you already have a POM. ## Using an existing repository -
cleberjamaral revised this gist
Oct 7, 2019 . 1 changed file with 3 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -19,9 +19,8 @@ In this how-to it is being explained how to create a maven repository on github ```rm -R ALL-PROJECT-SUB-FOLDERS``` ```rm ALL-PROJECT-FILES``` 1. run mvn install for jar creation (change GROUP, ARTIFACT-NAME, ARTIFACT-VERSION, PATH-TO-THE-JAR and PATH-TO-EXISTING-POM). See * for details. ```mvn install:install-file -DgroupId=GROUP -DartifactId=ARTIFACT-NAME -Dversion=ARTIFACT-VERSION -Dfile=PATH-TO-THE-JAR -Dpackaging=jar -DlocalRepositoryPath=. -DcreateChecksum=true -DgeneratePom=true``` 1. Add all files to be commited ```git add .``` @@ -37,6 +36,8 @@ In this how-to it is being explained how to create a maven repository on github maven { url "https://github.com/ORGANIZATION-NAME/PROJECT-NAME/raw/maven2" } ``` * * Your PATH-TO-THE-JAR will be something like: ```../PROJECT-NAME/build/libs/ARTIFACT-NAME-ARTIFACT-VERSION.jar```. Use ```-DpomFile=PATH-TO-EXISTING-POM``` instead of ```-DgeneratePom=true``` if you already have a POM. ## Using an existing repository If you already have a repository using this way explained above, you can use the following commands to setup another machine in order to update your repository. -
cleberjamaral revised this gist
Oct 7, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -21,7 +21,7 @@ In this how-to it is being explained how to create a maven repository on github 1. run mvn install for jar creation (change GROUP, ARTIFACT-NAME, ARTIFACT-VERSION, PATH-TO-THE-JAR and PATH-TO-EXISTING-POM). ```mvn install:install-file -DgroupId=GROUP -DartifactId=ARTIFACT-NAME -Dversion=ARTIFACT-VERSION -Dfile=PATH-TO-THE-JAR -Dpackaging=jar -DlocalRepositoryPath=. -DcreateChecksum=true -DgeneratePom=true``` 1. Your PATH-TO-THE-JAR will be something like: ```../PROJECT-NAME/build/libs/ARTIFACT-NAME-ARTIFACT-VERSION.jar```. Use ```-DpomFile=PATH-TO-EXISTING-POM``` instead of ```-DgeneratePom=true``` if you already have a POM. 1. Add all files to be commited ```git add .``` -
cleberjamaral revised this gist
Oct 7, 2019 . 1 changed file with 4 additions and 3 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -19,9 +19,10 @@ In this how-to it is being explained how to create a maven repository on github ```rm -R ALL-PROJECT-SUB-FOLDERS``` ```rm ALL-PROJECT-FILES``` 1. run mvn install for jar creation (change GROUP, ARTIFACT-NAME, ARTIFACT-VERSION, PATH-TO-THE-JAR and PATH-TO-EXISTING-POM). ```mvn install:install-file -DgroupId=GROUP -DartifactId=ARTIFACT-NAME -Dversion=ARTIFACT-VERSION -Dfile=PATH-TO-THE-JAR -Dpackaging=jar -DlocalRepositoryPath=. -DcreateChecksum=true -DgeneratePom=true``` * Your PATH-TO-THE-JAR will be something like: ```../PROJECT-NAME/build/libs/ARTIFACT-NAME-ARTIFACT-VERSION.jar```. Use ```-DpomFile=PATH-TO-EXISTING-POM``` instead of ```-DgeneratePom=true``` if you already have a POM. 1. Add all files to be commited ```git add .``` -
cleberjamaral revised this gist
Oct 7, 2019 . 1 changed file with 2 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -20,10 +20,8 @@ In this how-to it is being explained how to create a maven repository on github ```rm ALL-PROJECT-FILES``` 1. run mvn install for jar creation (change GROUP, ARTIFACT-NAME, ARTIFACT-VERSION, PATH-TO-THE-JAR and PATH-TO-EXISTING-POM). Your PATH-TO-THE-JAR will be something like: ```../PROJECT-NAME/build/libs/ARTIFACT-NAME-ARTIFACT-VERSION.jar```. Use ```-DpomFile=PATH-TO-EXISTING-POM``` instead of ```-DgeneratePom=true``` if you already have a POM. ```mvn install:install-file -DgroupId=GROUP -DartifactId=ARTIFACT-NAME -Dversion=ARTIFACT-VERSION \\ -Dfile=PATH-TO-THE-JAR -Dpackaging=jar -DlocalRepositoryPath=. -DcreateChecksum=true \\ -DgeneratePom=true``` 1. Add all files to be commited ```git add .``` -
cleberjamaral revised this gist
Oct 7, 2019 . 1 changed file with 1 addition and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -20,8 +20,7 @@ In this how-to it is being explained how to create a maven repository on github ```rm ALL-PROJECT-FILES``` 1. run mvn install for jar creation (change GROUP, ARTIFACT-NAME, ARTIFACT-VERSION, PATH-TO-THE-JAR and PATH-TO-EXISTING-POM). Your PATH-TO-THE-JAR will be something like: ```../PROJECT-NAME/build/libs/ARTIFACT-NAME-ARTIFACT-VERSION.jar```. Use ```-DpomFile=PATH-TO-EXISTING-POM``` instead of ```-DgeneratePom=true``` if you already have a POM. ```mvn install:install-file -DgroupId=GROUP -DartifactId=ARTIFACT-NAME -Dversion=ARTIFACT-VERSION \\ -Dfile=PATH-TO-THE-JAR -Dpackaging=jar -DlocalRepositoryPath=. -DcreateChecksum=true \\ -DgeneratePom=true ``` -
cleberjamaral revised this gist
Oct 7, 2019 . 1 changed file with 3 additions and 8 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -19,25 +19,20 @@ In this how-to it is being explained how to create a maven repository on github ```rm -R ALL-PROJECT-SUB-FOLDERS``` ```rm ALL-PROJECT-FILES``` 1. run mvn install for jar creation (change GROUP, ARTIFACT-NAME, ARTIFACT-VERSION, PATH-TO-THE-JAR and PATH-TO-EXISTING-POM). Your PATH-TO-THE-JAR will be something like: ```../PROJECT-NAME/build/libs/ARTIFACT-NAME-ARTIFACT-VERSION.jar```. Use ```-DpomFile=PATH-TO-EXISTING-POM``` instead of ```-DgeneratePom=true``` if you already have a POM. ```bash mvn install:install-file -DgroupId=GROUP -DartifactId=ARTIFACT-NAME -Dversion=ARTIFACT-VERSION \\ -Dfile=PATH-TO-THE-JAR -Dpackaging=jar -DlocalRepositoryPath=. -DcreateChecksum=true \\ -DgeneratePom=true ``` 1. Add all files to be commited ```git add .``` 1. Commit these changes ```git commit -m "Released version ARTIFACT-VERSION"``` 1. Push this commit. After that your maven structure for you project can be reached by github raw data address https://github.com/GROUP-NAME/PROJECT-NAME/raw/maven2 ```git push origin maven2``` 1. On gradle you can add this repository on 'repositories' ```bash -
cleberjamaral revised this gist
Oct 7, 2019 . 1 changed file with 3 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -4,9 +4,7 @@ In this how-to it is being explained how to create a maven repository on github ## Creating a repository 1. Clone your original project to a new local repository (change GROUP-NAME and PROJECT-NAME) ```git clone https://github.com/GROUP-NAME/PROJECT-NAME.git PROJECT-NAME-maven2``` 1. Go to the clonned repository (use your PROJECT-NAME-maven2) ```cd PROJECT-NAME-maven2``` @@ -18,10 +16,8 @@ In this how-to it is being explained how to create a maven repository on github ```git checkout maven2``` 1. Remove project original files, this branch is just for releases ```rm -R ALL-PROJECT-SUB-FOLDERS``` ```rm ALL-PROJECT-FILES``` 1. run mvn install for jar creation (change GROUP, ARTIFACT-NAME, ARTIFACT-VERSION, PATH-TO-THE-JAR and PATH-TO-EXISTING-POM) ```bash -
cleberjamaral revised this gist
Oct 7, 2019 . 1 changed file with 20 additions and 19 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -2,26 +2,28 @@ In this how-to it is being explained how to create a maven repository on github and how to use an existing one. ## Creating a repository 1. Clone your original project to a new local repository (change GROUP-NAME and PROJECT-NAME) ```git clone https://github.com/GROUP-NAME/PROJECT-NAME.git PROJECT-NAME-maven2``` 1. Go to the clonned repository (use your PROJECT-NAME-maven2) ```cd PROJECT-NAME-maven2``` 1. Create a branch for maven files ```git branch maven2``` 1. Switch to this new branch ```git checkout maven2``` 1. Remove project original files, this branch is just for releases ``` rm -R ALL-PROJECT-SUB-FOLDERS rm ALL-PROJECT-FILES ``` 1. run mvn install for jar creation (change GROUP, ARTIFACT-NAME, ARTIFACT-VERSION, PATH-TO-THE-JAR and PATH-TO-EXISTING-POM) ```bash mvn install:install-file -DgroupId=GROUP -DartifactId=ARTIFACT-NAME -Dversion=ARTIFACT-VERSION \\ -Dfile=PATH-TO-THE-JAR -Dpackaging=jar -DlocalRepositoryPath=. -DcreateChecksum=true \\ @@ -30,19 +32,18 @@ mvn install:install-file -DgroupId=GROUP -DartifactId=ARTIFACT-NAME -Dversion=AR Your PATH-TO-THE-JAR will be something like: ../PROJECT-NAME/build/libs/ARTIFACT-NAME-ARTIFACT-VERSION.jar Use -DpomFile=PATH-TO-EXISTING-POM instead of -DgeneratePom=true if you already have a POM 1. Add all files to be commited ```git add .``` 1. Commit these changes ```git commit -m "Released version ARTIFACT-VERSION"``` 1. Push this commit ```git push origin maven2``` Now maven structure for you project can be reached by github raw data address https://github.com/GROUP-NAME/PROJECT-NAME/raw/maven2 1. On gradle you can add this repository on 'repositories' ```bash maven { url "https://github.com/ORGANIZATION-NAME/PROJECT-NAME/raw/maven2" } ``` @@ -51,7 +52,7 @@ maven { url "https://github.com/ORGANIZATION-NAME/PROJECT-NAME/raw/maven2" } If you already have a repository using this way explained above, you can use the following commands to setup another machine in order to update your repository. 1. Clone your maven2 branch to a local folder which name is followed by "-maven2" (change GROUP-NAME and PROJECT-NAME) git clone https://github.com/GROUP-NAME/PROJECT-NAME.git PROJECT-NAME-maven2 --branch maven2 1. To update your maven2 repo, follow steps from run mvn install for jar creation -
cleberjamaral revised this gist
Oct 7, 2019 . 1 changed file with 1 addition and 0 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -5,6 +5,7 @@ In this how-to it is being explained how to create a maven repository on github ## Creating a repository 1. Clone your original project to a new local repository (change GROUP-NAME and PROJECT-NAME) ```git clone https://github.com/GROUP-NAME/PROJECT-NAME.git PROJECT-NAME-maven2``` 1. Go to the clonned repository (use your PROJECT-NAME-maven2) -
cleberjamaral revised this gist
Oct 7, 2019 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -5,7 +5,7 @@ In this how-to it is being explained how to create a maven repository on github ## Creating a repository 1. Clone your original project to a new local repository (change GROUP-NAME and PROJECT-NAME) ```git clone https://github.com/GROUP-NAME/PROJECT-NAME.git PROJECT-NAME-maven2``` 1. Go to the clonned repository (use your PROJECT-NAME-maven2) cd PROJECT-NAME-maven2 -
cleberjamaral revised this gist
Oct 7, 2019 . 1 changed file with 2 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -6,9 +6,10 @@ In this how-to it is being explained how to create a maven repository on github 1. Clone your original project to a new local repository (change GROUP-NAME and PROJECT-NAME) git clone https://github.com/GROUP-NAME/PROJECT-NAME.git PROJECT-NAME-maven2 1. Go to the clonned repository (use your PROJECT-NAME-maven2) cd PROJECT-NAME-maven2 1. Create a branch for maven files git branch maven2 -
cleberjamaral revised this gist
Oct 7, 2019 . 1 changed file with 3 additions and 4 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -4,13 +4,12 @@ In this how-to it is being explained how to create a maven repository on github ## Creating a repository 1. Clone your original project to a new local repository (change GROUP-NAME and PROJECT-NAME) git clone https://github.com/GROUP-NAME/PROJECT-NAME.git PROJECT-NAME-maven2 1. Go to the clonned repository (use your PROJECT-NAME-maven2) cd PROJECT-NAME-maven2 1. Create a branch for maven files git branch maven2 ### Switch to this new branch -
cleberjamaral revised this gist
Oct 7, 2019 . 1 changed file with 7 additions and 7 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -2,16 +2,16 @@ In this how-to it is being explained how to create a maven repository on github and how to use an existing one. ## Creating a repository ### Clone your original project to a new local repository (change GROUP-NAME and PROJECT-NAME) git clone https://github.com/GROUP-NAME/PROJECT-NAME.git PROJECT-NAME-maven2 ### Go to the clonned repository (use your PROJECT-NAME-maven2) cd PROJECT-NAME-maven2 ### Create a branch for maven files git branch maven2 ### Switch to this new branch git checkout maven2 -
cleberjamaral revised this gist
Oct 7, 2019 . 1 changed file with 32 additions and 17 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,41 +1,56 @@ # How to use github as a maven repository In this how-to it is being explained how to create a maven repository on github and how to use an existing one. ## Creating a repository ### Clone your original project to a new local repository (change GROUP-NAME and PROJECT-NAME) git clone https://github.com/GROUP-NAME/PROJECT-NAME.git PROJECT-NAME-maven2 ### Go to the clonned repository (use your PROJECT-NAME-maven2) cd PROJECT-NAME-maven2 ### Create a branch for maven files git branch maven2 ### Switch to this new branch git checkout maven2 ### Remove project original files, this branch is just for releases rm -R ALL-PROJECT-SUB-FOLDERS rm ALL-PROJECT-FILES ### run mvn install for jar creation (change GROUP, ARTIFACT-NAME, ARTIFACT-VERSION, PATH-TO-THE-JAR and PATH-TO-EXISTING-POM) ```bash mvn install:install-file -DgroupId=GROUP -DartifactId=ARTIFACT-NAME -Dversion=ARTIFACT-VERSION \\ -Dfile=PATH-TO-THE-JAR -Dpackaging=jar -DlocalRepositoryPath=. -DcreateChecksum=true \\ -DgeneratePom=true ``` Your PATH-TO-THE-JAR will be something like: ../PROJECT-NAME/build/libs/ARTIFACT-NAME-ARTIFACT-VERSION.jar Use -DpomFile=PATH-TO-EXISTING-POM instead of -DgeneratePom=true if you already have a POM ### Add all files to be commited git add . ### Commit these changes git commit -m "Released version ARTIFACT-VERSION" ### Push this commit git push origin maven2 ### Now maven structure for you project can be reached by github raw data address https://github.com/GROUP-NAME/PROJECT-NAME/raw/maven2 ### On gradle you can add this repository on 'repositories' ```bash maven { url "https://github.com/ORGANIZATION-NAME/PROJECT-NAME/raw/maven2" } ``` ## Using an existing repository If you already have a repository using this way explained above, you can use the following commands to setup another machine in order to update your repository. ### Clone your maven2 branch to a local folder which name is followed by "-maven2" (change GROUP-NAME and PROJECT-NAME) git clone https://github.com/GROUP-NAME/PROJECT-NAME.git PROJECT-NAME-maven2 --branch maven2 ### To update your maven2 repo, follow steps from run mvn install for jar creation -
cleberjamaral revised this gist
Oct 30, 2018 . 1 changed file with 3 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -18,9 +18,10 @@ rm -R ALL-PROJECT-FILES ## run mvn install for jar creation (change GROUP, ARTIFACT-NAME, ARTIFACT-VERSION, PATH-TO-THE-JAR and PATH-TO-EXISTING-POM) ```bash mvn install:install-file -DgroupId=GROUP -DartifactId=ARTIFACT-NAME -Dversion=ARTIFACT-VERSION \\ -Dfile=PATH-TO-THE-JAR -Dpackaging=jar -DlocalRepositoryPath=. -DcreateChecksum=true \\ -DpomFile=PATH-TO-EXISTING-POM ``` Use -DgeneratePom=true instead of -DpomFile=PATH-TO-EXISTING-POM to create POM ## Add all files to be commited git add . -
cleberjamaral revised this gist
Oct 29, 2018 . 1 changed file with 3 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -17,7 +17,9 @@ rm -R ALL-PROJECT-FILES ## run mvn install for jar creation (change GROUP, ARTIFACT-NAME, ARTIFACT-VERSION, PATH-TO-THE-JAR and PATH-TO-EXISTING-POM) ```bash mvn install:install-file -DgroupId=GROUP -DartifactId=ARTIFACT-NAME -Dversion=ARTIFACT-VERSION \\ -Dfile=PATH-TO-THE-JAR -Dpackaging=jar -DpomFile=PATH-TO-EXISTING-POM -DlocalRepositoryPath=. \\ -DcreateChecksum=true ``` ## Add all files to be commited -
cleberjamaral revised this gist
Oct 29, 2018 . 1 changed file with 2 additions and 2 deletions.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -15,9 +15,9 @@ git checkout maven2 ## Remove project original files, this branch is just for releases rm -R ALL-PROJECT-FILES ## run mvn install for jar creation (change GROUP, ARTIFACT-NAME, ARTIFACT-VERSION, PATH-TO-THE-JAR and PATH-TO-EXISTING-POM) ```bash mvn install:install-file -DgroupId=GROUP -DartifactId=ARTIFACT-NAME -Dversion=ARTIFACT-VERSION -Dfile=PATH-TO-THE-JAR -Dpackaging=jar -DpomFile=PATH-TO-EXISTING-POM -DlocalRepositoryPath=. -DcreateChecksum=true ``` ## Add all files to be commited -
cleberjamaral revised this gist
Oct 26, 2018 . 1 changed file with 1 addition and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -13,7 +13,7 @@ git branch maven2 git checkout maven2 ## Remove project original files, this branch is just for releases rm -R ALL-PROJECT-FILES ## run mvn install for jar creation (change GROUP, ARTIFACT-NAME, ARTIFACT-VERSION and PATH-TO-THE-JAR) ```bash -
cleberjamaral created this gist
Oct 26, 2018 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,38 @@ # How to use github as a maven repository ## Clone your original project to a new local repository (change ORGANIZATION-NAME and PROJECT-NAME) git clone https://github.com/ORGANIZATION-NAME/PROJECT-NAME.git PROJECT-NAME-maven2 ## Go to the clonned repository (use your PROJECT-NAME-maven2) cd PROJECT-NAME-maven2 ## Create a branch for maven files git branch maven2 ## Switch to this new branch git checkout maven2 ## Remove project original files, this branch is just for releases rm -R <ALL-PROJECT-FILES> ## run mvn install for jar creation (change GROUP, ARTIFACT-NAME, ARTIFACT-VERSION and PATH-TO-THE-JAR) ```bash mvn install:install-file -DgroupId=GROUP -DartifactId=ARTIFACT-NAME -Dversion=ARTIFACT-VERSION -Dfile=PATH-TO-THE-JAR -Dpackaging=jar -DgeneratePom=true -DlocalRepositoryPath=. -DcreateChecksum=true ``` ## Add all files to be commited git add . ## Commit these changes git commit -m "Released version ARTIFACT-VERSION" ## Push this commit git push origin maven2 ## Now maven structure for you project can be reached by github raw data address https://github.com/ORGANIZATION-NAME/PROJECT-NAME/raw/maven2 ## On gradle you can add this repository on 'repositories' ```bash maven { url "https://github.com/ORGANIZATION-NAME/PROJECT-NAME/raw/maven2" } ```