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

Eclipse IDE setup: resolving dom4j dependency #51

Open patric-r opened 4 years ago

patric-r commented 4 years ago

Question here.

First of all, thank you for this repo. It's good to see that there is still a BIRT community alive. I tried to follow your steps setup up the Eclipse IDE. However, a few (~100) build errors remain: dom4j imports cannot be resolved.

Is there something I missed? Thanks!

hvbtup commented 4 years ago

I haven't done so myself, but I remember that dom4j was metioned in birt\build\org.eclipse.birt.build\readme.txt

patric-r commented 4 years ago

Thanks for your comment, I'll have a look at the mentioned readme.txt

How do you build BIRT within eclipse (without any errors)?

hvbtup commented 4 years ago

Yesterday I was able to have the BIRT project inside the Eclipse IDE without red lights by following the instructions at https://github.com/Flugtiger/birt/wiki/How-to-setup-an-Eclipse-IDE-for-Eclipse-BIRT.

But to be honest, I still don't know how to generate/run/test from inside Eclipse.

For building, I use Maven on the command line as described on the other Wiki page. I wrote a little CMD script for this, which makes it a bit easier, but building this way takes about 20 minutes on my machine (and we already use a Nexus proxy).

My scripts look like this:

Script mvn-umgebung.cmd:

set JAVA_HOME=c:\prog\jdk\jdk1.8.40\jre set Path=c:\prog\PortableGit\bin;c:\prog\apache-maven-3.6.1\bin;%JAVA_HOME%\bin;%Path% set JAVA_TOOL_OPTIONS=-Xmx1024m -Xms1024m

Script build-birt.cmd:

@echo off setlocal call mvn-umgebung.cmd if exist birt ( pushd birt del /S /Q build git checkout build popd ) else ( git clone https://github.com/hvbtup/birt.git ) if not exist c:\prog\m2\toolchains.xml copy toolchains.xml c:\prog\m2\ pushd birt rem mvn --global-settings c:\prog\m2\settings.xml --global-toolchains c:\prog\m2\toolchains.xml clean package -DskipTests mvn --global-settings c:\prog\m2\settings.xml --global-toolchains c:\prog\m2\toolchains.xml package -DskipTests popd echo Das fertige Ecclipse sollte in folgendem Verzeichnis zu finden sein: echo birt\build\birt-packages\birt-report-all-in-one\targets\products endlocal

Note that the script deletes and the eintire build directory before building. This seems to be necessary to have a really clean build.

I then extract the birt-report-designer-all-in-one-...zip and then start the eclipse.exe in the extracted directory.

When I only have minor changes in a few files, in order to save time, I directly copy the corresponding .class files to the .jar files, e.g. like this:

rem Test the DOCX emitter

setlocal

rem Configuration set TODAY=%DATE% set YYYY=%TODAY:~6,4% set MM=%TODAY:~3,2% set DD=%TODAY:~0,2%

set BIRT_ECLIPSE_HOME=C:\prog\birt-report-designer-all-in-one-4.11.0-%YYYY%%MM%%DD%-win32.win32.x86_64\eclipse set SRC_DIR=C:\git\repos\birt\engine

rem Update some of the plugins

pushd %SRC_DIR% call :UPDATE_JARS org.eclipse.birt.report.engine.emitter.config.docx call :UPDATE_JARS org.eclipse.birt.report.engine.emitter.config.wpml call :UPDATE_JARS org.eclipse.birt.report.engine.emitter.docx call :UPDATE_JARS org.eclipse.birt.report.engine.emitter.wpml call :UPDATE_JARS org.eclipse.birt.report.engine.ooxml

popd

SET JAVA_HOME=C:\prog\jdk\jdk8u212-b03\jre SET PATH=%JAVA_HOME%\bin;%PATH% start %BIRT_ECLIPSE_HOME%\eclipsec.exe

endlocal goto :EOF

:UPDATE_JARS for %%I in (%BIRT_ECLIPSEHOME%\plugins\%1*.jar) do set THE_JAR=%%I C:\prog\jdk\jdk8u212-b03\bin\jar.exe uf %THE_JAR% -C %SRC_DIR%\%1\target\classes . goto :EOF

This is of course not the recommended way, but it works. I wish I knew a more elegant way...

Flugtiger commented 4 years ago

hi @patric-r , I'm glad there is someone interested in BIRT which has found his way to this repo. The error with dom4j is strange, the daily build of this repo ist still green (at least most of the time). Can you check your target definition whether everything was loaded correctly? Dom4J should be imported from Eclipse Orbit.

Test from inside eclipse can be started by choosing "Run As... -> Junit Plugin Test" given that all the build errors are gone (BIRT then can also be started from inside eclipse).

patric-r commented 4 years ago

@Flugtiger Thank you for your comment and sorry for the summer delay. First of all, which Eclipse SDK release do you use for building BIRT within Eclipse? Is it possible to use the most recent one?

After this has been clarified, I will make another attempt for creating a working build environment. Thanks!

patric-r commented 3 years ago

@Flugtiger As a kind reminder to the above, please. Which eclipse version does the project require? I was not able to get this working using the wiki article with eclipse 2020-09.

The oomph installation process failed to checkout the git project out-of-the-box: org.eclipse.jgit.api.errors.TransportException: git@github.com:flugtiger/birt.git: No more authentication methods available and the ooomph process stops. After cloning this repo manually and resuming oomph setup tasks, I get thousands of compile errors (but strangely, due to missing eclipse dependencies, like emf). Additionally eclipse asks for installing something from the Marketplace.

Flugtiger commented 3 years ago

@patric-r Sorry for waiting so long for a reply. This BIRT fork is currently far from being my top priority. I'm currently trying to follow my own "How-to install an Eclipse IDE for BIRT". I would recommend not using the most recent version of Eclipse for a BIRT IDE. Eclipse nowadays requires Java 11 to run and BIRT is far from supporting Java 11. The last Eclipse version that was able to run with Java 8 seems to be Eclipse 2020-06 so I will try this version together with AdoptOpenJDK 8.

Flugtiger commented 3 years ago

@patric-r When following my own "How-to" I also stumbled upon the errors you described.

  1. No more authentication methods available: git tries to clone the repository from github using ssh. A prerequisite for this to work is having a ssh-key generated on your machine and added to your github account.
  2. missing org.dom4j: In the project "org.eclipse.birt.build", dom4j is downloaded by a maven plugin and put into the lib subfolder. To make Eclipse pick the jar file up as a dependency, you can use a right-click on the project -> Maven -> Update project.
  3. there was another project which had a dependency loaded into the lib-subfolder by maven: "org.eclipse.birt.chart.device.pdf". This time the dependency is Apache fop and again Maven -> Update Project has helped.

I will try to mitigate these problems in the Oomph-setup soon, so that others don't run into these problems.

patric-r commented 3 years ago

@Flugtiger Thanks for your response. Regarding first point: Thanks, this was a silly issue, I overlooked that it used ssh. Fixed.

However, afterwards, following your step-by-step tutorial, oomph fails in the 2nd stage (after eclipse 2020-06 has been started):

Fetching content.xml.xz from http://download.eclipse.org/tools/orbit/downloads/drops2/R20181128170323/repository/ (84,82kB)
ERROR: org.eclipse.pde.core code=0 Problems occurred while resolving the target contents
  at org.eclipse.oomph.util.OomphPlugin.coreException(OomphPlugin.java:291)
  at org.eclipse.oomph.util.pde.TargetPlatformUtil.activateTargetDefinition(TargetPlatformUtil.java:151)
  at org.eclipse.oomph.setup.pde.impl.TargetPlatformTaskImpl.perform(TargetPlatformTaskImpl.java:293)
  at org.eclipse.oomph.setup.internal.core.SetupTaskPerformer.doPerformNeededSetupTasks(SetupTaskPerformer.java:3851)
  at org.eclipse.oomph.setup.internal.core.SetupTaskPerformer.access$1(SetupTaskPerformer.java:3794)
  at org.eclipse.oomph.setup.internal.core.SetupTaskPerformer$WorkspaceUtil$1.run(SetupTaskPerformer.java:5160)
  at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2292)
  at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2317)
  at org.eclipse.oomph.setup.internal.core.SetupTaskPerformer$WorkspaceUtil.performNeededSetupTasks(SetupTaskPerformer.java:5154)
  at org.eclipse.oomph.setup.internal.core.SetupTaskPerformer$WorkspaceUtil.access$0(SetupTaskPerformer.java:5152)
  at org.eclipse.oomph.setup.internal.core.SetupTaskPerformer.performNeededSetupTasks(SetupTaskPerformer.java:3785)
  at org.eclipse.oomph.setup.internal.core.SetupTaskPerformer.performTriggeredSetupTasks(SetupTaskPerformer.java:3760)
  at org.eclipse.oomph.setup.internal.core.SetupTaskPerformer.perform(SetupTaskPerformer.java:3638)
  at org.eclipse.oomph.setup.ui.wizards.ProgressPage$9.run(ProgressPage.java:595)
  at org.eclipse.oomph.setup.ui.wizards.ProgressPage$11$1.run(ProgressPage.java:722)
  at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)
  ERROR: org.eclipse.pde.core code=0 Problems loading repositories
    ERROR: org.eclipse.pde.core code=0 Problems loading repositories
      ERROR: org.eclipse.pde.core code=0 Unable to locate installable unit org.eclipse.emf.base.feature.group 2.17.0.v20181231-1705
      ERROR: org.eclipse.pde.core code=0 Unable to locate installable unit org.eclipse.emf.ecore.feature.group 2.17.0.v20181231-1705
      ERROR: org.eclipse.pde.core code=0 Unable to locate installable unit org.eclipse.emf.feature.group 2.17.0.v20190109-0952

So I had to click 'cancel' and not all eclipse dependencies could been resolved, therefore BIRT build breaks... Any hints?

Flugtiger commented 3 years ago

Can you check whether the bundles that could not be resolved are still available in the given orbit repo (http://download.eclipse.org/tools/orbit/downloads/drops2/R20181128170323/repository/)? If yes, it might be a simple connection problem.