Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Publish Maven Build To Central #625

Open
pipebaum opened this issue Mar 24, 2021 · 203 comments
Open

Publish Maven Build To Central #625

pipebaum opened this issue Mar 24, 2021 · 203 comments
Milestone

Comments

@pipebaum
Copy link

Currently, there is no automated feature to publish the BIRT-Runtime to Maven. Wouldn't it be nice to fix this.

@pipebaum
Copy link
Author

@wimjongman Do you or anyone you know have experiencing setting this up? What we would like is to be able to automatically deploy/publish the Runtime to Maven Central. To date, we have been doing this by hand, it would be great if we could do this in the easiest way possible. @SteveSchafer-Innovent

@wimjongman
Copy link
Contributor

@pipebaum
Copy link
Author

pipebaum commented Apr 30, 2021 via email

@martins-1992
Copy link

Hello there,
we are currently working on integrating BIRT into a private service for report generation.
We noticed that there is currently no public build release of the BIRT runtime.

We were able to build the BIRT runtime locally and will probably integrate the runtime by using the build jars
as dependencies.

Can we help you, in order to get a public build release on Maven Central?

@wimjongman
Copy link
Contributor

Can we help you, in order to get a public build release on Maven Central?

Yes, that would be great. You can create PR's referencing this issue.

@martins-1992
Copy link

What are the release problems?

@martins-1992
Copy link

We could setup a release workflow, where a release is uploaded to Github first
and find issues with the build process that way.

We have done it for our project as well: https://github.com/minova-afis/aero.minova.core.application.system/blob/master/.github/workflows/release.yml

The only thing needed to my knowledge are a username and an access token for Github,
as a secret in the project.

@wimjongman wimjongman added this to the 4.10 milestone Mar 15, 2022
@wimjongman
Copy link
Contributor

@splitcells, @pipebaum can we re-start working on this?

@martins-1992
Copy link

martins-1992 commented Mar 15, 2022

@wimjongman It is not known, what is needed or if a Maven Central release is desired.

@JacquesLeRoux
Copy link

Hi,

I'm not sure what your problem is, but for sure a Maven Central release is desired by us, see #863

@wimjongman
Copy link
Contributor

This is what is currently inside the maven repo [1]. Our official build is in Jenkins [2].

[1] https://mvnrepository.com/artifact/org.eclipse.birt
[2] https://ci.eclipse.org/birt/

@martins-1992
Copy link

martins-1992 commented Mar 15, 2022

Which one is the release workflow or what are the commands used for release?
Is it this one? https://ci.eclipse.org/birt/job/populate-build-lists/

@wimjongman
Copy link
Contributor

The birt-master job creates all the artifacts. The artifacts are then uploaded here [1]

We used to have a process to make milestones and release candidates but we are going to skip that for now.

Finally, there will be a job that will move the artifacts from the downloads/snapshots and update-site/snapshots to a final release location.

Then there could be another job that uploads these artifacts to maven central. I guess the artifacts to upload are the bundles in update-site/snapshots/plugins

[1] https://download.eclipse.org/birt/

@martins-1992
Copy link

martins-1992 commented Mar 16, 2022

You mentioned earlier, that you tried something?
What are the commands executed for the release?
What were the errors?

That way, we have a common process to start from.

@wimjongman
Copy link
Contributor

I have tried once and failed...

That was for a different project and a long while ago.

@SteveSchafer-Innovent
Copy link
Contributor

SteveSchafer-Innovent commented Mar 16, 2022

I can take this on and I'd like to publish 4.9 manually to make sure all the requirements are met before automating it. Maybe have automation a goal for 4.10.

Do we want to publish just the runtime or everything?

@pipebaum
Copy link
Author

pipebaum commented Mar 16, 2022 via email

@wimjongman
Copy link
Contributor

Thanks, Steve!

I'm not sure what is meant with the Runtime. This is what is currently on maven:

https://mvnrepository.com/artifact/org.eclipse.birt

@JacquesLeRoux
Copy link

JacquesLeRoux commented Mar 17, 2022

If that's of any help, this is what I'm interested with: https://mvnrepository.com/artifact/org.eclipse.birt.runtime/viewservlets

What I'm looking for is a security fix: #863

@cristatus
Copy link

Quite happy to see BIRT is alive again :)

We are stuck on 4.4.2 and would love to upgrade 4.9.0 but need maven artifacts in central. BTW, the 4.4.2 runtime artifact loads lots of dependencies, better if most of the data connectors are made separate artifacts.

@wimjongman
Copy link
Contributor

Thanks, Amit. We are looking forward to your patches ;)

@Tostino
Copy link

Tostino commented Mar 18, 2022

Also quite interested in seeing this published to Maven. Would appreciate both the runtime and also viewservlets.

Super excited to see activity in this project again!

@hvbtup
Copy link
Contributor

hvbtup commented Mar 18, 2022

birt.war is part of the runtime.

@SteveSchafer-Innovent
Copy link
Contributor

SteveSchafer-Innovent commented Mar 18, 2022

Thanks, Steve!

I'm not sure what is meant with the Runtime. This is what is currently on maven:

https://mvnrepository.com/artifact/org.eclipse.birt

When I think of runtime I think of what's built into build/birt-packages/birt-runtime/target and also what we could download called "birt runtime". It includes all the classes you need to be able to generate BIRT reports in your own application. It also includes the web app and the war file. I think when people want a maven repo, it's so they can conveniently include the necessary classes in their own app.

I'll need to find out if there's a way to build the runtime independently or construct a pom that will do that. That will be the root and then everything it depends on will need to be also published to central. All the pom's will need to meet the maven requirements including <licenses>, <scm>, and PGP signatures. Since this will involved a lot of changes to pom.xml files and 4.9 is now frozen I'll probably need to publish from my fork in order to publish 4.9. Once we get 4.9 successfully published we can make sure 4.10 is ready to go.

https://maven.apache.org/repository/guide-central-repository-upload.html

When I published 4.8 under the Innovent name I pushed all the jar files to Sonatype OSSRH. There is also a mechanism for running your own repository manager. That might be overkill for us but let me know what you think.

https://central.sonatype.org/publish/large-orgs/

@wimjongman
Copy link
Contributor

Sounds good Steve. I don't think we need our own repo manager, but you be the judge.

I am happy to release 4.10 early, there is no reason to postpone a release when we have some great new stuff to offer.

Here is a link to the platform publish wiki: https://wiki.eclipse.org/Platform-releng/Publish_to_Maven_Central

@SteveSchafer-Innovent
Copy link
Contributor

I can publish to the group com.innoventsolutions, but in order to publish to org.eclipse or any sub-groups, I would need the sonatype jira credentials of whoever owns org.eclipse.

@JacquesLeRoux
Copy link

It would be quite better if it was under org.eclipse.

@martins-1992
Copy link

martins-1992 commented Mar 20, 2022

@SteveSchafer-Innovent

I can publish to the group com.innoventsolutions, but in order to publish to org.eclipse or any sub-groups, I would need the sonatype jira credentials of whoever owns org.eclipse.

What commands are you using?
mvn release:prepare & release:perform?
Will the commands be added to the repo?

Sry, for the noobish question.

@SteveSchafer-Innovent
Copy link
Contributor

@splitcells, although I have published to central before I haven't published using maven so I'm just as much a noob as you are in that area, but I can say that any modifications to the pom files will be part of the repo. My comments about group ownership came from reading https://central.sonatype.org/publish/requirements/coordinates/#choose-your-coordinates.

@Marks13
Copy link

Marks13 commented Apr 18, 2024

I recently had to work on the integration of an updated BiRT dependency as the solution of @siepkes broken some of my transitive dependencies for logging (no offense, at least you shared something that was extremely valuable).

You'll find it below.

https://gist.github.com/Marks13/94fd7de500297e9c6b9830a5f167e5c1

@m-thirumal
Copy link

Can this issue be resolved anytime sooner?

@hvbtup
Copy link
Contributor

hvbtup commented May 10, 2024

@m-thirumal Yes, if you provide a solution to it.

If you have read this issue in detail, you should have seen that there is no easy solution.
Several clever people have tried it without success.

You should not expect a solution soon.
But there are reasonable workarounds, eg. from @siepkes and @Marks13.

A solution seems to depend on understanding and cleaning up the build process, besides others, AFAIK. The build process is "historical grown", meaning that is a complicated mess.

@wimjongman
Copy link
Contributor

The build process is "historical grown", meaning that is a complicated mess.

It no longer is thanks to Ed @merks 💞

@merks
Copy link
Contributor

merks commented May 10, 2024

There have been some discussions with folks potentially willing to provide sponsorship to align with their wishes. If wishes were fishes…

@eureka-bpo
Copy link

We made a service for working with p2-artifacts from maven-projects. Enjoy it!

We have added adaptation of BIRT for maven project. For our aims it was quite enough. May be it will helpful for your projects too

@wimjongman wimjongman modified the milestones: 4.16, 4.17 Jun 11, 2024
@flozano
Copy link

flozano commented Jun 19, 2024

I periodically check this issue and noticed that the milestones were modified:
image

does it means that 4.17 is going to be in maven central?

@wimjongman
Copy link
Contributor

If you work on it, then yes.

@flozano
Copy link

flozano commented Jun 19, 2024

I understand. Thank you!

@christophersavory
Copy link

Looks like @SteveSchafer-Innovent got this partially working back in 2022. I see that 4.9.0 was published (manually?) to maven central. It's not very clearly outlined in this issue what is the work remaining to get this automation in place for each release.

@christophersavory
Copy link

@wimjongman please see previous comment

@hvbtup
Copy link
Contributor

hvbtup commented Jul 18, 2024

I'm just watching this silently and I don't know anything about it, but AFAIK ATM @merks is working hard to simplify the build process.

I believe that the Maven build has been very complex manual work (and that nobody is able to do this) because the build process is a mess.

As soon as Ed has simplified and cleaned up the build process to a point when at least it can be comprehensed by experienced Java/Eclipse developers with some good will, maybe someone can tackle this Maven issue, but before that, it hardly makes sense.

And BTW "pinging" issues does not help anyone IMHO. We are well aware that the lacking availability of BIRT in the Maven repository is a major issue. If you want to speed up development, maybe you can ask Ed how you can help?

@christophersavory
Copy link

If you read my comment, I was trying to get an idea of what is the work remaining. Thank you for your explanation.

If you want to speed up development, maybe you can ask Ed how you can help?

How is this done other than asking him here?

@flozano
Copy link

flozano commented Jul 19, 2024

Maybe I'm the one to blame for "pinging"? I did in the context of a milestone change in the issue:
image

with the intention of understanding if this milestone change means that 4.17 was expected to be in maven central, or if it was just issues/milestones maintenance... My apologies if that was considered unhelpful or rude; that was not the intention.

@wimjongman
Copy link
Contributor

wimjongman commented Jul 19, 2024

Please go ahead and keep pinging the issue. However, we require someone from the community with good experience in this matter to help here.

And BTW "pinging" issues does not help anyone IMHO.

@hvbtup Sorry I just read this :) A bit of mixed advice from our side... ;)

@merks
Copy link
Contributor

merks commented Jul 19, 2024

Supporting BIRT's release engineering is already a lot of work and cleaning up the existing mess is a daunting task:

No one funds this effort, the on-going releng effort, nor even the bug fixes and helpful discussion answers. I do the releng work primarily to help the committers of the project. I really admire our committers!

Adding publishing to Maven Central to this workload literally just creates yet more work for me. I have other work for which I'm actually compensated, e.g., publishing the Platform to Maven Central, which is a prerequisite to BIRT doing so. As you might imagine, the burden of yet more free work is uncompelling at best.

I think it's really time for all the folks who benefit from all this free goodness, including all the free goodness provided by the folks improving the BIRT implementation, fixing the bugs, and answering the question to step up and support the effort with more than just wishes and emojis. I expect the companies you work for collectively make more money in a day than I make in a year.

So get involved in the IDE WG and then we talk about priorities:

https://eclipseide.org/membership/

No one there currently considers BIRT a priority...


Attached is an outline that I wrote to describe what I believe needs to be done and how it should be done:

BIRT-Details.pdf

Consider that it's possible sponsor your wishes and that this will prove much more effective than pings and emojis.

@SteveSchafer-Innovent
Copy link
Contributor

Scott's original issue asked if we could publish the BIRT (non-osgi) runtime. That's all I think most people care about. The runtime basically consists of a fat jar and a lot of other jars. The easy and ugly way to do it is to publish all the jars as new artifacts and make the fat jar dependent on all the other jars. That's what I did for the innovent 4.8 runtime. People can then include the fat jar as a dependency on their pom to get a working BIRT runtime in their project. Yes most of those jars are redundant to artifacts already in maven, but there's a lot of redundancy in maven anyway, so I'm not sure that's so bad.

Recently I started to think about how to eliminate those redundancies and I came up with the idea of using the maven REST API to search maven in a kind-of automated way. Unfortunately, it's sometimes hard to find an existing artifact on maven even if it already exists, if all you have to go in is the name of a jar file which doesn't really match the maven coordinates. So I was able to write a script that found a lot of the artifacts using simple logic but then I had to add a lot of exceptions and was ultimately able to locate maybe 90% of the artifacts. Then I had to resolve any doubt that what I found in maven was REALLY the same as my jar file. In the end it turned out to be a lot of work and would take a lot of maintenance, so probably isn't worth doing.

I'm sure Ed Merk's approach is better but it requires a deeper understanding of P2 and Orbit than I currently have (although learning new things is always good). Maybe a hybrid approach would work. I have a few weeks during which I can spend time on this before I get busy with other stuff and would be happy to do some research/learning.

@merks, can you direct me to where I can learn more about "CBI p2 Aggregator" which you mentioned in your PDF?

@hvbtup
Copy link
Contributor

hvbtup commented Jul 24, 2024

Scott's original issue asked if we could publish the BIRT (non-osgi) runtime. That's all I think most people care about.

I think you are right. This is all that's needed to execute BIRT reports and that's what probably > 99% of people need.
We shouldn't care for the < 1% of people who want to integrate the BIRT designer into their applications.

@hvbtup
Copy link
Contributor

hvbtup commented Jul 24, 2024

Some remarks on @merks analysis in BIRT-Details PDF:

E.g., does it make sense to publish to Maven Central bundles that are effectively only useful in a running Eclipse IDE? I think probably not.

+1

I propose that we publish only those components with no Eclipse IDE dependencies, i.e., this subset.

+1

We might also consider to omit org.eclipse.birt.chart.device.swt given its SWT dependencies probably makes is not an interesting Maven artifact.

Not sure.
I think it should only be included iff it is needed to generate charts as bitmaps (I don't know).

The Platform and the EMF publish BIRT’s required dependencies to Maven Central, but DataTools does not.
That will need to be addressed; it could be addressed by publishing these to BIRT’s coordinate space rather than by asking the DataTools project to publish its own artufacts to Maven Central

+1 for the idea of moving this into BIRT's coordinate space.
Looking at the datatools GitHub pages, it seems like this project is effectively abandoned (just like BIRT was a few years ago). The vast majority of commits there since 2022 were from @merks.
I reckon that this project is used only from within BIRT, more or less .
Otherwise there would be more activitiy eg. to adress new kinds of data sources, in particular column-based data like Apache Arrow.

... Apache Derby: One gotcha with this new version is that it requires Java 21 effectively requires BIRT as a whole to
move to Java 21. This slightly older version does not: ... But the latest version fixes a CVE…

Probably most users of BIRT only use Apache Derby for the builtin demo database.
I think we should go with the latest Java 17 release of Apache Derby for now.
Requiring BIRT users to use Java 21 will drive them away from BIRT; the step towards Java 17 was/is hard enough for many of them. If we decide later that BIRT should use Java 21 (independent from this issue), then we still can update the Apache Derby dependency.

Regarding the proposals:

... ensuring that said infrastructure is automated such that consuming and providing newer versions as they
become available in the future is a light-weight process.
We must be prepared to address security problems by providing and consuming new versions quickly and easily.

+1

Regarding the technical details about how to achieve these goals:
I don't understand it (but hopefully experienced Eclipse developers do), so I cannot comment on it.

Additionally, I propose to publish SNAPSHOT builds to repo.eclipse.org.

+1

In addition, someone needs to consider whether the artifacts I propose to publish are sufficient and
are those that are actually needed.

From my POV: yes.

@merks
Copy link
Contributor

merks commented Jul 24, 2024

I'm not sure we can say definitely what most people care about. Certainly no one cares enough to do the work themselves nor to sponsor the work being done. As they say, what goes around, comes around. (I see very little coming around).

In any case, if folks are happy with a dump, why not just dump the one entire zip and call it done?

  • birt-runtime-4.17.0-202407231035.zip

If folks are happy to have an exploded repackaged version of birt-runtime*.zip, that can be done external to the build, repackaging the build results. There are currently 141 additional jars. It feels like an abomination to republish those, but that's just my personal feeling. Moreover, in our increasingly security-conscious world, I expect that folks will want to know exactly where the artifacts come from and what exactly is in them (to be sure that nothing untoward and been stuffed into them while migrating from one coordinate to another). So I fully expect the results of republishing to be a major hassle for consumers, but that's just my personal expectation.

Also note that what is in the runtime is really poorly defined. These 141 libraries effectively include the transitive dependencies of the Eclipse workbench. That can't really be necessary can it? That really ought to be cleaned up before we dump things to Maven Central. The cleanup tasks for BIRT appears to be never ending. 😱


Note that almost all the current Orbit dependencies have links to their Maven origins as generated on this summary page:

https://download.eclipse.org/tools/orbit/simrel/orbit-aggregation/table.html

I'm trying to get WTP to use purely artifacts from the above repository, but that's proving a bit of a challenge. Unfortunately BIRT depends on WTP (though the runtime does not) so some of the older artifacts leak in through WTP. (I do have PRs to fix all those issues in WTP).

Note that Orbit has a bunch of Maven crawlers and analyzers that are used to keep Orbit up-to-date as new dependencies are published to Maven Central. Like for BIRT, there's an Oomph setup for that if you want to have a look at that:

https://github.com/eclipse-orbit/orbit-simrel/blob/main/CONTRIBUTING.md

Finding things on Maven Central is a challenge at best. Maven Central is a midden heap in which the crown jewels are stored. It's especially challenging to find artifacts based on the Java packages they provide. That was a big problem for me when cleaning up the mess that was Orbit. So I prototyped an index/crawler that lets me do test search like this.

image

Unfortunately Apache has a habit of publishing garbage artifacts, even artifacts without sources. So for Derby, it's a significantly challenge and workload to even produce a functional bundle (in my copious free spare time). Basically I'll need to do get the original build results and repackage them:

https://dlcdn.apache.org/db/derby/db-derby-10.16.1.1/

And then I'm not even sure how to test that what I produce is fully functional. 😢


Here is the repository where the CBI Aggregator is maintained (by me):

https://github.com/eclipse-cbi/p2repo-aggregator

Documentation links are there. Some of the newer features of the aggregator (e.g., dependency mapping of Java package dependencies, import to Maven publishing) are not yet documented. So much to do...


All the Platform's infrastructure for publishing to Maven Central is in this folder:

https://github.com/eclipse-platform/eclipse.platform.releng.aggregator/tree/master/eclipse.platform.releng/publish-to-maven-central

The jobs driven by these definitions and scripts are here:

https://ci.eclipse.org/releng/view/Publish%20to%20Maven/

One aspect of publishing to Maven central, at least via the Nexus servers we use from Eclipse is that one must include a source jar and a javadoc jar for every jar published. A significant amount of the ugly scripting in the above is associated with this gotcha. It's also all too easy to publish results with broken dependencies, so the Platform's processes carefully test that the Maven dependencies all actually resolve. Note that the Platform does not republish any 3rd party libraries.


The DataTools project is in maintenance purely by my personal efforts, as noted above. It's also used by EMF (ODA) and by Web Tools Project.


The following are my personal, politically-incorrect opinions. I think it's great that our awesome committers provide the community with regular quality releases, helpful answers, and so on. That helps to set high expectations. The community's wish and hope for publishing to Maven Central is completely understandable. But I can assure everyone that for a project has complex, and with as many dependencies, as BIRT, this is an ocean boiling exercise that is even for me, with decades of experience with this entire technology stack and with a decade of experience with the build infrastructure, a daunting task.

But hey, if someone wants to do the work, doesn't consume an unbounded amount of my personal time to help with that work, and doesn't permanently increase my maintenance workload going forward, then that's all find and good. Just be warned that this is an effort where a month of work is likely to be insufficient. Failing that effort, what the community cares about should be reflected in community's actions and therein lies the biggest shortcoming. What goes around, comes around.

@wimjongman wimjongman modified the milestones: 4.17, 4.18 Sep 16, 2024
@wimjongman wimjongman modified the milestones: 4.18, 4.19 Dec 4, 2024
@mquan86
Copy link

mquan86 commented Dec 20, 2024

A summary note to myself and perhaps for everyone about the current state of this case:

  • Some effort to publish version 4.9 to Maven, it is done, but I can't see a link to artifact? What I found so far seems this one. But it is just seems a big fat zip. I'm not sure what is the use case for it. (Also it will fail Gradle resolving as it depends on birt-runtime-osgi and that doesn't have POM file? I don't have time to check further on this case. And seems that zip file is useless to my particular use case (I need runtime jar part only - similar to this or this (fat jars)).
  • The workaround so far:
    • Local respository, means you download the distribution file yourself, extract all jars file and use script or whatever to import it.
      • For Maven this or this
      • For Gradle, I found that I can just simply declare it as below (if I extracts jar to libs folder)
        • implementation fileTree('libs') { include '*.jar' }
      • These approaches has problems that:
        • Manually download distribution, upgrade or downgrade require similar efforst (vs changing version number in pom/gradle file).
        • Dependencies hell (e.g. that fat jars include slf4j confliction that you ususally want to exclude manually).
        • Project sources control (Git/SVN) has to store binary files (jar) which usually not a good pratices or recommended.
    • eureka-bpo made an online repository that user can just use directly, but a concern about security level and answered here. I'm not a security expert so can't comment on this answer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests