Flugtiger / birt

Eclipse BIRT™ The open source reporting and data visualization project.
http://www.eclipse.org/birt
Eclipse Public License 1.0
5 stars 4 forks source link

Write a Wiki page of how to build BIRT #7

Closed Flugtiger closed 5 years ago

Flugtiger commented 5 years ago

To make it easier for new contributors, there should be a short howto on github that describes the build process of BIRT.

hvbargen commented 5 years ago

I could do with some help. I developed some patches for earlier eclipse versions, namely to improve the Word emitter. I'm unsatisfied with the overall situation of the BIRT project, it seems to be more or less abandoned. Nevertheless, since the company I'm working for rewrote all reports with BIRT, I think pushing the project forward again is worth a try. What I'm trying to do is to

1) Use the patched Word emitter. 2) replace the PDF emitter with a new implementation based on Apache PDFBox instead of iText (not adding any functionality).

The next steps would then be to support

3) PDF/A and maybe 4) PDF/UA and 5) support execution of SQL/DML from javascript.

I know this won't be easy...

Please note that 1) and 5) are already working with BIRT 4.2.1 and 4.3.0.

Unfortunately, I'm more or less a noob regarding maven, p2 etc.

What I tried now, as "step 0", is to compile BIRT from source.

Unfortunately, this failed, and I'm lost:

This is what I did:

Download Maven, JDK 1.8 (AdoptJDK), and git. Set up environment variables accordingly (PATH and JAVA_HOME, I'm on Windows 10). Download the source with git clone. Inside the birt directory, run mvn package -Poxygen -DskiptTests

This fails with an error message

[INFO] Resolving dependencies of MavenProject: org.eclipse.birt:org.eclipse.birt.p2updatesite:4.8.0-SNAPSHOT @ D:\prog\birt-git\birt\build\org.eclipse.birt.p2updatesite\pom.xml [INFO] {osgi.os=win32, osgi.ws=win32, org.eclipse.update.install.features=true, osgi.arch=x86_64} [ERROR] Cannot resolve project dependencies: [ERROR] Software being installed: org.eclipse.birt.designer 4.8.0.qualifier [ERROR] Missing requirement: org.eclipse.birt.feature.group 4.8.0.qualifier requires 'org.eclipse.jetty.osgi.boot 0.0.0' but it could not be found [ERROR] Cannot satisfy dependency: org.eclipse.birt.designer 4.8.0.qualifier depends on: org.eclipse.birt.feature.group 0.0.0

Obviously, some serious problem here. The instructions in readme.md are not complete. Any help appreciated...

Flugtiger commented 5 years ago

Hi! Did you use my forked repo or the upstream repo? In this fork I made some changes to the build process (the target platform is now defined in a PDE platform definition file) that currently only work for the photon build. I'm currently still uncertain how to apply my changes to the builds for legacy eclipse versions (and whether I need to support those at all). Why do you need to build for oxygen?

To solve your problem, you might try to build for photon and see if it works then or use the upstream repo to build for oxygen.

Best regards Alex

hvbargen commented 5 years ago

Here's what I did: Create a new directory d:\prog\birt-git. Inside this directory, using a CMD shell:

D:\prog\birt-git\birt>mvn -v Apache Maven 3.6.1 (d66c9c0b3152b2e69ee9bac180bb8fcc8e6af555; 2019-04-04T21:00:29+02:00) Maven home: d:\prog\apache-maven-3.6.1\bin.. Java version: 1.8.0_212, vendor: AdoptOpenJDK, runtime: d:\prog\jdk8\jre Default locale: de_DE, platform encoding: Cp1252 OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

D:\prog\birt-git>git clone https://github.com/Flugtiger/birt.git Cloning into 'birt'... remote: Enumerating objects: 630684, done. remote: Total 630684 (delta 0), reused 0 (delta 0), pack-reused 630684R Receiving objects: 100% (630684/630684), 179.81 MiB | 5.69 MiB/s, done. Resolving deltas: 100% (341461/341461), done. Checking out files: 100% (18910/18910), done.

D:\prog\birt-git>cd birt

D:\prog\birt-git\birt>mvn package -Pphoton -DskipTests [INFO] Scanning for projects... [INFO] Computing target platform for MavenProject: org.eclipse.birt:org.eclipse.birt.p2updatesite:4.8.0-SNAPSHOT @ D:\prog\birt-git\birt\build\org.eclipse.birt.p2updatesite\pom.xml [INFO] Fetching p2.index from http://download.eclipse.org/eclipse/updates/4.8/ [INFO] Adding repository http://download.eclipse.org/eclipse/updates/4.8 [INFO] Fetching p2.index from http://download.eclipse.org/eclipse/updates/4.8/R-4.8-201806110500/ [INFO] Fetching p2.index from http://download.eclipse.org/eclipse/updates/4.8/R-4.8-201806110500/ [INFO] Adding repository http://download.eclipse.org/modeling/emf/emf/builds/milestone/latest [INFO] Fetching p2.index from http://download.eclipse.org/modeling/emf/emf/builds/milestone/S201904050820/ [INFO] Fetching p2.index from http://download.eclipse.org/modeling/emf/emf/builds/milestone/S201904050820/ [INFO] Adding repository http://download.eclipse.org/datatools/1.14.1.201712071719/repository [INFO] Fetching p2.index from http://download.eclipse.org/tools/gef/updates/legacy/releases/ [INFO] Fetching p2.index from http://download.eclipse.org/tools/gef/updates/legacy/releases/ [INFO] Adding repository http://download.eclipse.org/tools/gef/updates/legacy/releases [INFO] Adding repository http://download.eclipse.org/webtools/downloads/drops/R3.9.5/R-3.9.5-20180409100740/repository [INFO] Adding repository http://download.eclipse.org/jetty/updates/jetty-bundles-9.x/9.4.10.v20180503 [INFO] Adding repository http://download.eclipse.org/gemini/updates/web/3.0.4 [INFO] Fetching p2.index from http://download.eclipse.org/tools/orbit/downloads/drops/R20181128170323/repository/ [INFO] Fetching p2.index from http://download.eclipse.org/tools/orbit/downloads/drops/R20181128170323/repository/ [INFO] Adding repository http://download.eclipse.org/tools/orbit/downloads/drops/R20181128170323/repository [INFO] Fetching p2.index from http://download.eclipse.org/tools/orbit/downloads/drops2/R20181128170323/repository/ [INFO] Fetching p2.index from http://download.eclipse.org/tools/orbit/downloads/drops2/R20181128170323/repository/ [INFO] Resolving dependencies of MavenProject: org.eclipse.birt:org.eclipse.birt.p2updatesite:4.8.0-SNAPSHOT @ D:\prog\birt-git\birt\build\org.eclipse.birt.p2updatesite\pom.xml [INFO] Fetching com.google.gson_2.8.2.v20180104-1110.jar.pack.gz from http://download.eclipse.org/tools/orbit/downloads/drops2/R20181128170323/repository/plugins/ (79,97kB) [INFO] Fetching &countryCode=de&timeZone=1&format=xml from http://www.eclipse.org/downloads/download.php?format=xml&file=/webtools/downloads/drops/R3.9.5/R-3.9.5-20180409100740/repository/ [ERROR] Internal error: java.lang.NullPointerException -> [Help 1] org.apache.maven.InternalErrorException: Internal error: java.lang.NullPointerException at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:120) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288) at org.apache.maven.cli.MavenCli.main (MavenCli.java:192) ... etc ...

So, no luck.

Flugtiger commented 5 years ago

Hi, I tried to reproduce this error and had no success. Could you please supply the full stack trace including all 'caused by' sections?

hvbargen commented 5 years ago

OK, here is the full output from the console session:

D:\prog>type mvn-umgebung.cmd @echo off set PATH=%WINDIR%\System32;%WINDIR%;%WINDIR%\System32\WBEM

set PATH=%PATH%;d:\prog\jdk8\bin set PATH=%PATH%;C:\Program Files\Git\cmd set JAVA_HOME=d:\prog\jdk8

set PATH=%PATH%;d:\prog\apache-maven-3.6.1\bin

D:\prog>mvn-umgebung.cmd

D:\prog>cd birt-git

D:\prog\birt-git>java -version openjdk version "1.8.0_212" OpenJDK Runtime Environment (AdoptOpenJDK)(build 1.8.0_212-b03) OpenJDK 64-Bit Server VM (AdoptOpenJDK)(build 25.212-b03, mixed mode)

D:\prog\birt-git>mvn -version Apache Maven 3.6.1 (d66c9c0b3152b2e69ee9bac180bb8fcc8e6af555; 2019-04-04T21:00:29+02:00) Maven home: d:\prog\apache-maven-3.6.1\bin.. Java version: 1.8.0_212, vendor: AdoptOpenJDK, runtime: d:\prog\jdk8\jre Default locale: de_DE, platform encoding: Cp1252 OS name: "windows 10", version: "10.0", arch: "amd64", family: "windows"

D:\prog\birt-git>git clone https://github.com/Flugtiger/birt.git Cloning into 'birt'... remote: Enumerating objects: 630684, done. remote: Total 630684 (delta 0), reused 0 (delta 0), pack-reused 630684 Receiving objects: 100% (630684/630684), 179.81 MiB | 5.03 MiB/s, done. Resolving deltas: 100% (341461/341461), done. Checking out files: 100% (18910/18910), done.

D:\prog\birt-git>cd birt

D:\prog\birt-git\birt>mvn package -Pphoton -DskipTests [INFO] Scanning for projects... [INFO] Computing target platform for MavenProject: org.eclipse.birt:org.eclipse.birt.p2updatesite:4.8.0-SNAPSHOT @ D:\prog\birt-git\birt\build\org.eclipse.birt.p2updatesite\pom.xml [INFO] Fetching p2.index from http://download.eclipse.org/eclipse/updates/4.8/ [INFO] Fetching p2.index from http://download.eclipse.org/eclipse/updates/4.8/ [INFO] Adding repository http://download.eclipse.org/eclipse/updates/4.8 [INFO] Fetching p2.index from http://download.eclipse.org/eclipse/updates/4.8/R-4.8-201806110500/ [INFO] Fetching p2.index from http://download.eclipse.org/eclipse/updates/4.8/R-4.8-201806110500/ [INFO] Adding repository http://download.eclipse.org/modeling/emf/emf/builds/milestone/latest [INFO] Fetching compositeContent.jar from http://download.eclipse.org/modeling/emf/emf/builds/milestone/latest/ (436B) [INFO] Fetching compositeContent.jar from http://download.eclipse.org/modeling/emf/emf/builds/milestone/latest/ (436B) [INFO] Fetching p2.index from http://download.eclipse.org/modeling/emf/emf/builds/milestone/S201904250840/ [INFO] Fetching p2.index from http://download.eclipse.org/modeling/emf/emf/builds/milestone/S201904250840/ [INFO] Fetching content.xml.xz from http://download.eclipse.org/modeling/emf/emf/builds/milestone/S201904250840/ [INFO] Fetching content.xml.xz from http://download.eclipse.org/modeling/emf/emf/builds/milestone/S201904250840/ [INFO] Adding repository http://download.eclipse.org/datatools/1.14.1.201712071719/repository [INFO] Fetching p2.index from http://download.eclipse.org/tools/gef/updates/legacy/releases/ [INFO] Fetching p2.index from http://download.eclipse.org/tools/gef/updates/legacy/releases/ [INFO] Adding repository http://download.eclipse.org/tools/gef/updates/legacy/releases [INFO] Adding repository http://download.eclipse.org/webtools/downloads/drops/R3.9.5/R-3.9.5-20180409100740/repository [INFO] Adding repository http://download.eclipse.org/jetty/updates/jetty-bundles-9.x/9.4.10.v20180503 [INFO] Adding repository http://download.eclipse.org/gemini/updates/web/3.0.4 [INFO] Fetching p2.index from http://download.eclipse.org/tools/orbit/downloads/drops/R20181128170323/repository/ [INFO] Fetching p2.index from http://download.eclipse.org/tools/orbit/downloads/drops/R20181128170323/repository/ [INFO] Adding repository http://download.eclipse.org/tools/orbit/downloads/drops/R20181128170323/repository [INFO] Fetching p2.index from http://download.eclipse.org/tools/orbit/downloads/drops2/R20181128170323/repository/ [INFO] Fetching p2.index from http://download.eclipse.org/tools/orbit/downloads/drops2/R20181128170323/repository/ [INFO] Resolving dependencies of MavenProject: org.eclipse.birt:org.eclipse.birt.p2updatesite:4.8.0-SNAPSHOT @ D:\prog\birt-git\birt\build\org.eclipse.birt.p2updatesite\pom.xml [INFO] Fetching com.google.gson_2.8.2.v20180104-1110.jar.pack.gz from http://download.eclipse.org/tools/orbit/downloads/drops2/R20181128170323/repository/plugins/ (79,97kB) [INFO] Fetching com.google.gson_2.8.2.v20180104-1110.jar.pack.gz from http://download.eclipse.org/tools/orbit/downloads/drops2/R20181128170323/repository/plugins/ (79,97kB) [INFO] Fetching &countryCode=de&timeZone=1&format=xml from http://www.eclipse.org/downloads/download.php?format=xml&file=/webtools/downloads/drops/R3.9.5/R-3.9.5-20180409100740/repository/ [ERROR] Internal error: java.lang.NullPointerException -> [Help 1] org.apache.maven.InternalErrorException: Internal error: java.lang.NullPointerException at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:120) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288) at org.apache.maven.cli.MavenCli.main (MavenCli.java:192) at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) Caused by: java.lang.NullPointerException at org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepository.downloadArtifact (SimpleArtifactRepository.java:666) at org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepository.downloadArtifact (SimpleArtifactRepository.java:591) at org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepository.getArtifact (SimpleArtifactRepository.java:723) at org.eclipse.tycho.repository.p2base.artifact.repository.RepositoryArtifactProvider.getArtifactFromOneMirror (RepositoryArtifactProvider.java:229) at org.eclipse.tycho.repository.p2base.artifact.repository.RepositoryArtifactProvider.getArtifactFromAnyMirror (RepositoryArtifactProvider.java:212) at org.eclipse.tycho.repository.p2base.artifact.repository.RepositoryArtifactProvider.access$1 (RepositoryArtifactProvider.java:207) at org.eclipse.tycho.repository.p2base.artifact.repository.RepositoryArtifactProvider$1.perform (RepositoryArtifactProvider.java:187) at org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepository.getArtifact (SimpleArtifactRepository.java:707) at org.eclipse.equinox.internal.p2.artifact.repository.simple.SimpleArtifactRepository.getArtifacts (SimpleArtifactRepository.java:778) at org.eclipse.tycho.repository.p2base.artifact.repository.RepositoryArtifactProvider.getArtifactFromAnyChildRepository (RepositoryArtifactProvider.java:199) at org.eclipse.tycho.repository.p2base.artifact.repository.RepositoryArtifactProvider.getArtifactFromAnyFormatAvailableInRepository (RepositoryArtifactProvider.java:168) at org.eclipse.tycho.repository.p2base.artifact.repository.RepositoryArtifactProvider.getArtifactFromAnySource (RepositoryArtifactProvider.java:154) at org.eclipse.tycho.repository.p2base.artifact.provider.CompositeArtifactProviderBaseImpl.getArtifact (CompositeArtifactProviderBaseImpl.java:52) at org.eclipse.tycho.repository.local.MirroringArtifactProvider.downloadCanonicalArtifact (MirroringArtifactProvider.java:244) at org.eclipse.tycho.repository.local.MirroringArtifactProvider.downloadMostSpecificNeededFormatOfArtifact (MirroringArtifactProvider.java:237) at org.eclipse.tycho.repository.local.MirroringArtifactProvider.downloadArtifact (MirroringArtifactProvider.java:222) at org.eclipse.tycho.repository.local.MirroringArtifactProvider.makeOneFormatLocallyAvailable (MirroringArtifactProvider.java:211) at org.eclipse.tycho.repository.local.MirroringArtifactProvider.makeLocallyAvailable (MirroringArtifactProvider.java:182) at org.eclipse.tycho.repository.local.MirroringArtifactProvider.getArtifactFile (MirroringArtifactProvider.java:121) at org.eclipse.tycho.repository.p2base.artifact.provider.CompositeArtifactProvider.getArtifactFile (CompositeArtifactProvider.java:85) at org.eclipse.tycho.p2.target.TargetPlatformBaseImpl.getLocalArtifactFile (TargetPlatformBaseImpl.java:128) at org.eclipse.tycho.p2.resolver.P2ResolverImpl.addUnit (P2ResolverImpl.java:254) at org.eclipse.tycho.p2.resolver.P2ResolverImpl.toResolutionResult (P2ResolverImpl.java:217) at org.eclipse.tycho.p2.resolver.P2ResolverImpl.resolveDependencies (P2ResolverImpl.java:209) at org.eclipse.tycho.p2.resolver.P2ResolverImpl.resolveDependencies (P2ResolverImpl.java:116) at org.eclipse.tycho.p2.resolver.P2DependencyResolver.doResolveDependencies (P2DependencyResolver.java:367) at org.eclipse.tycho.p2.resolver.P2DependencyResolver.resolveDependencies (P2DependencyResolver.java:335) at org.eclipse.tycho.core.resolver.DefaultTychoResolver.resolveProject (DefaultTychoResolver.java:117) at org.eclipse.tycho.core.maven.TychoMavenLifecycleParticipant.afterProjectsRead (TychoMavenLifecycleParticipant.java:95) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:264) at org.apache.maven.DefaultMaven.doExecute (DefaultMaven.java:192) at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:105) at org.apache.maven.cli.MavenCli.execute (MavenCli.java:956) at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288) at org.apache.maven.cli.MavenCli.main (MavenCli.java:192) at sun.reflect.NativeMethodAccessorImpl.invoke0 (Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke (NativeMethodAccessorImpl.java:62) at sun.reflect.DelegatingMethodAccessorImpl.invoke (DelegatingMethodAccessorImpl.java:43) at java.lang.reflect.Method.invoke (Method.java:498) at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced (Launcher.java:282) at org.codehaus.plexus.classworlds.launcher.Launcher.launch (Launcher.java:225) at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode (Launcher.java:406) at org.codehaus.plexus.classworlds.launcher.Launcher.main (Launcher.java:347) [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/InternalErrorException

D:\prog\birt-git\birt>

Flugtiger commented 5 years ago

hmm, this might be a problem with an update site. You could try: mvn clean package -DskipTests -Dtycho.disableP2Mirrors

hvbargen commented 5 years ago

Thx, that helped a lot. Still not finished, though.

Your suggestion alone didn't help, tons of error messages.

But then I deleted my C:\users\.....\.m2 directory and tried again. This time, it worked a lot better, but still failed, with a different error message:

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-toolchains-plugin:1.1:toolchain (default) on project org.eclipse.birt-parent: Cannot find matching toolchain definitions for the following toolchain types: [ERROR] jdk [ id='JavaSE-1.8' ] [ERROR] Please make sure you define the required toolchains in your ~/.m2/toolchains.xml file.

So I copied the file travis-maven-toolchain.xml to my .m2 directory, renamed it to toolchains.xml, then edited the path to the JDK inside the file.

Then once again I tried the mvn command on the command line (without clean this time)... It took forever, but finally, it said: ... [INFO] BUILD SUCCESS ...

But I don't know how to start the generated Eclipse then:

In the directory D:\prog\birt-git\birt\build\birt-packages\birt-report-all-in-one\target a file birt-report-all-in-one-4.8.0-SNAPSHOT.zip has been generated with a size of 237 MB.

This archive contains a directory binary, which contains other files, which are ZIP files despite the file suffix. Among these files are eclipsec.exe and eclipse.exe.

After unpacking the archive birt-report-designer-all-in-one*.zip to a new directory D:\prog\birt-generiert-test` and copying the contents of the archives inside the binary directory to this directory as well, it looks promising.

However, starting eclipse.exe then fails with an error message:

The eclipse executable launcher was unable to locate its companion shared library.

And there's no eclipse.ini file...

Comparing the folder structure with e.g. birt-report-designer-all-in-one_4_3_2.zip from the official download site, more files and directories are missing:

What are the last steps?

Flugtiger commented 5 years ago

Hi,

cool, glad I could help :-) . You should find a zip file containing an assembled Eclipse + report designer inside the folder "C:...\git\birt\build\birt-packages\birt-report-all-in-one\target\products"

hvbargen commented 5 years ago

Thanks a lot! Finally, I have a working Eclipse BIRT IDE compiled from source. The story of this ticket should serve as a good basis for the intended Wiki page :-)

Flugtiger commented 5 years ago

I created a new wiki page: How to build Eclipse BIRT so this ticket is solved. I created a new separate ticket for documenting how to setup an IDE: #20