This is the easiest way, I've ever seen, to share and deploy a java project. |
1) GitHub eschews binary files.
2) GitHub doesnt have native understanding of what maven "is". So you don't get pretty little download links.
As an alternative, a few months ago, I posted some code you can use to build a javascript based maven based download site for your jar artifacts (i.e. a simple, read only, flat version of archiva/nexus view of a maven repository).
This web page simply creates links by reading the maven-metadata.xml file, to the jars. That way, end users who just want to grab your jar without using maven can easily do so (this is useful if you expect non-java types, i.e. admins or devops folks to be using your jar for a backend system).
BUT ALAS NOW WE HAVE BinTray !
BinTray makes it super easy to deploy jar files to a public server. I got it working in about an hour after poking around with the site.
1) Go and register on the bintray.com site. You can use your github account.
2) Create a simple maven project.
mvn archetype:generate -DgroupId=com.redhat.hcfs -DartifactId=hcfs-utils -DarchetypeArtifactId=maven-archetype-quickstart -DinteractiveMode=false3) Now that you have a project, create a repository in BinTray.
4) Then create a package inside of that repository.
5) Now at the upper right hand corner, you can click "set me up", and bintray will tell you exactly what to add to your maven settings.xml and your pom.xml files, to deploy.
6) Now, deploy your maven file. BinTray is for releases, so you will want to remove any SNAPSHOT versioning from the pom file, otherwise, you'll get a 400 exception.
Tada ! That was easy. You now have your jars hosted on a maintained maven site. Its also super easy to glue your bintray maven repository in with a maven central mirror, so that you don't have to manually go through the maven central hoops for maintaining your jars.
No comments:
Post a Comment