Maven artifact repository

Hello,
I wanted to ask if openems packages/artifacts/jars are deployed to any maven-style repository server? I mean artifactory or nexus. I ask cause I can’t find it in central and can’t see it in gradle build.

Best,
Łukasz

Hi Łukasz,

no, currently we do not deploy like that yet. We have Github Actions in place and actively work on improving them:

But maven-style repo is currently not on the immediate roadmap… could you support? What is your use-case?

Thanks & Regards,
Stefan

Hello Stefan,
My use case is embedding openems into Karaf and integrate with openhab. While I know that there are ways to source data from both - openhab and openems, doing so requires configuration management and makes it a large manual task. I’d rather try to experiment with assembling both in single runtime to see how they can be plugged together.

Given that your artifacts have a valid OSGi metadata and run on another OSGi runtime I suppose it should be rather easy task. However, in order to assembly Karaf feature I have to access artifacts somewhere/somehow. For most of libraries/components I use mvn: protocol which can scan configured maven repositories. The protocol uses maven resolver which traverse some metadata and skip maven poms (these are not used for runtime).
Source maven repository doesn’t have to be a central, it can be repository hosted through github, literally anything which follow maven conventions (nexus, artifactory etc.).

@da-Kai this sounds like a topic for you :smiley:

I had a look on gradle maven publishing docs. While it looked trivial, I’ve failed with first attempt - I’ve got both pom and jar, but only for one component and not others. Will play a bit with it to see how to twist it into right direction.

Answering my own post. I’ve spent a handful set of hours trying to understand gradle and its build execution and still do not have working solution.

Few questions:

  1. I see that submodules do not have dependency information, where it is taken from?
  2. There are plenty of examples how to get maven publishing, but for root project.
  3. The multi-module maven publication seem to be a bit challenging, at least from example point of view. The Spring stuff uses fairly complex build in general, which applies conventions etc. using pre-compiled plugin/task.

Given that build seem to be quite basic, I suppose you are not interested in making it more complicated, hence I’m looking forward to hear your opinion on it.
After all, I can script this stuff by using bash, if dependency information is available.

// Edit, I see - dependency information is populated by bnd workspace plugin. Clever.
// Edit2, There is existing bnd plugin -pom BOOLEAN PROPERTIES | bnd which can generate pom!

I’ve managed to push this through bnd itself:

It is less than obvious how to configure that and it requires conditional switches in order to swap release and snapshot repository as well as version mask.

A small summary of changes so far (I’ll try to come with a PR):

# build.bnd
# important part - centralize version management with static qualifier,
# this qualifier is substituted with ${-snapshot} instruction.
Bundle-Version: 1.0.0.SNAPSHOT

-include: ${if;${def;release};\
  ${.}/release.bnd;\
  ${.}/snapshot.bnd\
}
# Reproducible build - do not put headers which insert build timestamp, other than we wish
-noextraheaders: true
-reproducible: true

#--
# snapshot.bnd
-snapshot: ${tstamp}

-pom: \
	groupid=io.openems, \
	version=${versionmask;===;${@version}}-SNAPSHOT

#--
# release.bnd
-pom: \
	groupid=io.openems, \
	version=${versionmask;===;${@version}}

Pull request with related changes: