Pushing Labkey Java API to Maven Central

LabKey Support Forum (Inactive)
Pushing Labkey Java API to Maven Central lewis j mcgibbney  2015-03-17 12:02
Status: Closed
 
Hi Folks,
I've implemented the necessary implementation for publishing the Java API (jar, javadoc.jar, sources.jar and signatures) to Maven Central via sonatype.
I have a patch and I would like to make this available for you guys for whenever you want to do it in the future.
Additionally, I've logged and issue with Sonatype to make the artifacts available
https://issues.sonatype.org/browse/OSSRH-14496
https://oss.sonatype.org/content/repositories/central_bundles-3673/
I've attached the patch here... this can be applied against trunk and should be run as follows

$ patch -p0 -i LABKEY-JAVA_API.patch
$ mv maven-ant-tasks-2.1.3.jar remoteapi/java/ivy/
$ cd remoteapi/java/
$ ant -lib ivy/ deploy
The generated artifacts are then pushed to https://oss.sonatype.org/content/repositories/
This makes our life much easier as we can then directly consume the Java API within our project build e.g. Maven, Ivy. Gradle, Grails, etc.
Please let me know if there is somewhere else I can post the patch.

Thank you
Lewis
 
 
Jon (LabKey DevOps) responded:  2015-03-17 12:17
Hi Lewis,

Thank you for providing this to us. We will have this reviewed by our developers and get back to you.

Regards,

Jon
 
lewis j mcgibbney responded:  2015-03-17 12:32
No problems Jon.
I should say, if you want to get the maven-ant-tasks-2.1.3.jar, you can grab it from the URL below
http://search.maven.org/#artifactdetails|org.apache.maven|maven-ant-tasks|2.1.3|jar
Lewis
 
lewis j mcgibbney responded:  2015-03-17 12:41
Hi Jon,
Just a heads up, I pushed the Java artifacts to Maven central.
https://issues.sonatype.org/browse/OSSRH-14496
https://repo1.maven.org/maven2/org/labkey/labkey-client-api/
Thanks
 
lewis j mcgibbney responded:  2015-06-01 16:00
Hi Folks,
Was this ever integrated into Labkey? I wonder if the Java API will be produced as part of the release process from now on and if there is anything else I can do to make this better. We are consuming the Labkey API and have an interest in ensuring the Java API is publicly available on Maven Central.
Thanks
 
Jon (LabKey DevOps) responded:  2015-06-01 20:39
Hi Lewis,

We don't have any new information to report to you at this time, but we will let you know when we have an update.

Regards,

Jon
 
lewis j mcgibbney responded:  2015-06-01 23:24
Hi Jon,
Sounds good. It would be great to see the Java API's distributed and made available as part of the Labkey releases. We consume the Java API's directly and this patch enables that as can be seen below
http://search.maven.org/#artifactdetails|org.labkey|labkey-client-api|0.1|jar
I'll ping this one again in the near future and see what else I can do to potentially get the patch into the codebase.
Thanks for the feedback.
 
adam responded:  2015-07-01 18:17
We'll look at pushing the latest version of the Java API around the time of our 15.2 release (mid July). See https://www.labkey.org/issues/home/Developer/issues/details.view?issueId=22865 for more info.

Adam
 
lewis j mcgibbney responded:  2015-10-02 11:16
Hi Folks,
Please see updated patch which can be applied against trunk.
It can be applied as follows

cd $LABKEY_HOME
patch -p0 -i LABKEY-JAVA_APIv2.patch

Please see above for using the maven-ant-tasks artifact to produce and public your artifact to staging within Sonatype OSSRH.

Additionally, this patch augments some functionality within the remoteapi build.xml descriptior by adding description attributes to each target. This means we can execute the following

lmcgibbn@LMC-032857 /usr/local/labkey_trunk/remoteapi/java(joshua) $ ant -projecthelp
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option PermSize=1024m; support was removed in 8.0
Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=2048m; support was removed in 8.0
Buildfile: /usr/local/labkey_trunk/remoteapi/java/build.xml

Main targets:

 build --> build the .jar artifact if it is not up-to-date.
 build_if_dirty --> build the .jar artifact if source code is dirty.
 clean --> delete the build artifacts and compiled Java code.
 compile --> compile and build Java source code.
 deploy --> deploy to Sonatype OSSRH
 dist --> build the packaged distribution.
 jar --> generate the labkey Java .jar artifacts.
 javadoc --> build the Java API documentation.
 rebuild --> clean and then rebuild the .jar artifact.
 release --> generate the release distribution
Default target: build
 
jeckels responded:  2015-10-07 15:28
Hi Lewis,

I reviewed and committed the patch with revision 39927 with some very small tweaks, mostly around targeting a separate directory when generating the Maven-related JavaDoc so that we don't end up with overlapping files with the other JavaDoc build.

I've kept the issue open so track pushing a new build to Maven as we complete 15.3.

Thanks,
Josh
 
lewis j mcgibbney responded:  2015-10-08 04:36
Nice one Josh. Glad to hear I can pull the remote client API for every release from now on. Good work. Thank you for update.
 
Jon (LabKey DevOps) responded:  2016-01-21 17:58
Hi Lewis,

Both process and instructions have been developed and v15.3 of the client api has been pushed to Central.

Regards,

Jon