Build package programmatically | Community
Skip to main content
ronnyfm
Level 4
January 2, 2017
Solved

Build package programmatically

  • January 2, 2017
  • 11 replies
  • 10008 views

Hello,

I am able to assemble a package using the JcrPackageManager assemble method, however in the package manager I get the package definition and the filters, but the package itself needs to be built. I am sure there should be a way, since it is possible via the HTTP interface using curl.

Thanks.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by ronnyfm

Found the issue, I was calling:

assemble(JcrPackageDefinition definition, ProgressTrackerListener listener, java.io.OutputStream out)

But that writes the file to the output stream requiring therefore an additional build step. The solution was to invoke:

assemble(JcrPackage pack, ProgressTrackerListener listener)

Thanks all for your time.

11 replies

July 13, 2020

Hello,

JcrPackageManager.create will creates the package. You need to pass packagegroupname and packagename  as the parameters for create method.
Hope this helps.

Regards,

Mahi