Hosting executable .jar files in BitBucket repo or automate packaging executable .jar files from git into local folder

chmscrbbrfck :

I am trying to create a launcher application in Java that can invoke executable .jar files. An easy way for this is to host the executable .jar files in a cloud instance and the launcher application would just download the .jar files from there into the user's local folder. The dilemma is the absence of the cloud service or a server that can host the jar files.

As a workaround, I thought I can just host the jar files in BitBucket and that is where the launcher application will download the executable files from. Though, I think this is a little unconventional since it is mostly used to version source codes (please correct me if I am wrong). Also, I am not sure if it would be possible to invoke FTP or download files from there (perhaps through BitBucket API, maybe?).

Another option is that it could be possible to make the launcher app to create executable jar files from the git repo and download the package executable jar files into the user's folder and invoke from there. If this is possible, I would appreciate any leads towards this option.

Thanks!

Navneet kumar :

yes you can push your binaries to github (getting raw content is difficult from bitbuket your request need to have authentication and stuff).

here is how to for that

copying here as well in case get's removed.

How to create a maven repository for your github project step by step Clone your project in a separate folder (note: replace ORGANIZATION and PROJECT)

git clone git clone [email protected]:ORGANIZATION/PROJECT.git my-repository

cd into it cd my-repository

Create a new branch (here named repository) git branch repository

Switch to that branch git checkout repository

Remove all files rm -rf file1 file2 file3 .. etc

Install your jar in that directory (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

Add all generated files, commit and push git add -A . && git commit -m "released version X.Y.Z"

git push origin repository

Reference your jar from a different project The repository url you just created is > https://raw.github.com/YOUR_ORGANIZATION/YOUR_ARTIFACT/repository/

2nd option is also a good approach as you user will get always the updated content but that will add building time into it, depends on your use case.

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=346144&siteId=1