This is a guide for SavaPage Development Partners on how to install and configure Eclipse IDE for SavaPage development.
Status : under construction
Download latest stable version of Eclipse IDE for Java EE Developers.
cd ~/applications tar -zxvf eclipse-jee-2024-06-R-linux-gtk-x86_64.tar.gz
Install from Eclipse Marketplace:
Sun Checks - (Global)
coding convention for all Java projects.
In the package explorer, in the upper right corner of the view, there is a little icon with tool tip text “View Menu”. From that menu, select “Filters and Customization”. On the “Pre-set filters” tab, uncheck .* resources
.
Select Window → Preferences → Java → Compiler
11
Select Window → Preferences → Java → Installed JREs
Important | Make sure the openjdk source package is installed, so its Javadoc is available in Eclipse. |
---|
# if openjdk-11 is installed, then ... sudo apt install openjdk-11-source
To prevent “Duplicate generator defined in this persistence unit” messages:
Select Window → Preferences → Java Persistence →JPA → Errors/Warnings
Under “Queries and generators” mark “Duplicate generator defined” as Ignore
.
Select Window → Preferences → Java → Code Style → Formatter
savapage-make/eclipse/CodeFormatterProfileJava.xml
.Select Window → Preferences → Java → Code Style → Code Templates → Comments → Types
@author ${user}
to @author Your Name
.Select Window → Preferences. Select JavaScript, or Web → HTML Files → Client-side JavaScript. Select Code Style → Formatter
savapage-make/eclipse/CodeFormatterProfileJavaScript.xml
.Select Window → Preferences → General → Editors → Text Editors
Check the following items:
4
80
Select Window → Preferences → XML → XML Files → Editor
.metadata/.plugins/org.eclipse.core.runtime/.settings/org.eclipse.wst.xml.core.prefs
and change/add indentationSize=4
Select Window → Preferences → Java → Editor → Save Actions
Not applicable in Eclipse 2019-03 (4.11.0) ?
Eclipse 2020-06
Select Window → Preferences → Web → CSS Files → Editor
Select Window → Preferences → Web → HTML Files → Editor
Maven is integrated into Eclipse, but the central repository index needs to be rebuild, so we can select dependencies.
Select Window → Show View → Other
Also set up index to update on Eclipse start-up.
Prerequisite | All relevant repositories are cloned into ~/savapage/repos/ as explained in the “Getting started” section of savapage-make/README.md . |
Important | To contribute code, fork/clone the target SavaPage repositories. Edit/commit in develop branch, and create Merge Requests to push changes upstream. |
Create savapage-make/.project
file …
<?xml version="1.0" encoding="UTF-8"?> <projectDescription> <name>savapage-make</name> <comment/> <projects/> <buildSpec/> <natures/> </projectDescription>
… and import this project via “Import → General → Existing Projects” into Workspace.
Download/install thirdparty files in addition to SavaPage.
cd ~/savapage wget https://www.savapage.org/download/development/thirdparty-savapage-fonts.tar.gz -O - | tar -xz
Add each Maven project with: File → Import → Maven → Existing Maven Projects.
For each project, select the project in the Project Explorer and select the project properties.
Sun Checks -(Global)
Select the savapage-core project, right-click and select from main menu: Run As → Run Configurations… and Right-click on “Java Application”.
Select “New Configuration” and enter the following on tab “Main”:
Name | AppDb |
Main class | org.savapage.core.cli.AppDb |
On tab “Arguments” enter the following “Program Arguments”:
${string_prompt}
On tab “Arguments” enter the following “VM arguments”:
-Dserver.home=${project_loc}/../savapage-server/server.home -Dlog4j.configuration=file://${project_loc}/../savapage-server/server.home/lib/log4j.properties
Select “New Configuration” and enter the following on tab “Main”:
Name | App |
Main class | org.savapage.core.cli.server.App |
On tab “Arguments” enter the following “Program Arguments”:
${string_prompt}
On tab “Arguments” enter the following “VM arguments”:
-Dserver.home=${project_loc}/../savapage-server/server.home -Dlog4j.configuration=file://${project_loc}/../savapage-server/server.home/lib/log4j.properties
Embed fonts:
cd ~/savapage/repos/savapage-core cd src/main/java/org/savapage/core/fonts/ mkdir truetype # copy font directories from thirdparty cp -r ~/savapage/thirdparty-savapage/fonts/savapage/0.9.7/* truetype/
savapage-core
project propertiessavapage-core/src/main/java
source folder.Included: (All)
and Excluded: (None)
is selected. In this way XML and PNG and .properties files used in the Jasper Reports will be present in the Output folder
, as needed for testing in the Eclipse environment.savapage-core/src/main/resources
source folder.Included: (All)
and Excluded: (None)
is selected. In this way the Hibernate META-INF/persistence.xml
files will be present in the Output folder
, as needed for testing in the Eclipse environment.Beware | Java Build Path settings might be (bug?) overwritten when performing a “Maven → Update project” action. |
Note | Also see savapage-server build path problems. |
savapage-make/eclipse/server.home.template
to savapage-server/server.home
.savapage-make/eclipse/server.home.template.md
file.Select the savapage-server project, right-click and select from main menu: Run As → Run Configurations…
Right-click on “Java Application”, select “New Configuration” and enter the following on tab “Main”:
Name | WebServer |
Main class | org.savapage.server.WebServer |
On tab “Arguments” enter the following “VM arguments”:
-Dserver.home=${project_loc}/server.home -Dclient.home=${project_loc}/client.home -Dwicket.configuration=development -Dlog4j.configuration=file://${project_loc}/server.home/lib/log4j.properties -Dcom.sun.management.config.file=${project_loc}/server.home/jmxremote.properties -Djava.net.preferIPv4Stack=true -Djava.io.tmpdir=${project_loc}/server.home/tmp
Java-11 | As explained in java –help-extra add –illegal-access=debug as first line to “VM arguments”. This will write a stack-trace to stdout so “Illegal reflective access warnings” can be pinpointed. Add –add-opens jdk.management/com.sun.management.internal=ALL-UNNAMED as second line. |
Note | Use -Dwicket.configuration=deployment if you want to run in deployment mode. |
IMPORTANT
savapage-ext-*
projects, their target/classes
folders must be added (“Add Class Folder…”) to the “Java Build Path → Libraries” of the `savapage-server` project.savapage-i18n-*
projects, their target/classes
folders must be added (“Add Class Folder…”) to the “Java Build Path → Libraries” of the savapage-server
project.IMPORTANT :
savapage-server/src/main/java
source folder.Included: (All)
and Excluded: (None)
is selected. In this way the Wicket *.html
files will be present in the Output folder
, as needed for testing in the Eclipse environment.**/*.html
to the Included
section (where **/*.java
most probably is already present)Note | Also see build savapage-core path problems. |
Create directory savapage-server/client.home/
and copy SAVAPAGE.ppd
to it.
Copy content from savapage-make/setup-template/savapage/server/lib/log4j.properties
to savapage-server/server.home/lib/log4j.properties
and add/replace:
# ... ### log messages to stdout ### log4j.appender.stdout=org.apache.log4j.ConsoleAppender log4j.appender.stdout.layout=org.apache.log4j.PatternLayout log4j.appender.stdout.layout.ConversionPattern=%d{ISO8601} %5p %c{1}:%L - %m [%t]%n log4j.appender.stdout.encoding=UTF8 # ... log4j.rootLogger=ERROR, file, stdout # ... # end-of-file
Copy content from: savapage-make/setup-template/savapage/server/server.properties
to savapage-server/server.home/server.properties
, and:
server.port=8080 server.ssl.port=8443 server.print.port.raw=9101
Create directory savapage-client/client.home/
with the following files:
client.home/log4j.properties
client.home/app/config/client.properties
savapage-make/setup-template/savapage/client/app/config/client.properties
and edit server-host
, server-port
and optionally other values.### direct log messages to stdout ### log4j.appender.Stdout=org.apache.log4j.ConsoleAppender log4j.appender.Stdout.layout=org.apache.log4j.PatternLayout log4j.appender.Stdout.layout.conversionPattern=%d{ISO8601} %-5p %c{1}:%L - %m [%t]\n ### direct messages to file ### log4j.appender.file=org.apache.log4j.RollingFileAppender log4j.appender.file.MaxFileSize=10MB log4j.appender.file.MaxBackupIndex=10 log4j.appender.file.File=${app.home}/logs/client.log log4j.appender.file.layout=org.apache.log4j.PatternLayout log4j.appender.file.layout.ConversionPattern=%d{ISO8601} %5p %c{1}:%L - %m [%t]%n log4j.appender.file.encoding=UTF8 ### log4j.rootLogger=ERROR, Stdout, file ### log4j.logger.org.savapage=WARN #log4j.logger.org.eclipse.jetty=DEBUG #log4j.logger.org.cometd=DEBUG # end-of-file
Select the savapage-client project, right-click and select from main menu: Run As → Run Configurations…
Right-click on “Java Application”, select “New Configuration” and enter the following on tab “Main”:
Name | ClientApp |
Main class | org.savapage.client.ClientApp |
On tab “Arguments” enter the following “Program Arguments”:
${string_prompt}
On tab “Arguments” enter the following “VM arguments”:
-Dapp.home=${project_loc}/client.home -Dapp.name=savapage-client -Dlog4j.configuration=file://${project_loc}/client.home/log4j.properties
Select the savapage-util project, right-click and select from main menu: Run As → Run Configurations…
Right-click on “Java Application”, select “New Configuration” and enter the following on tab “Main”:
Name | AppUtil |
Main class | org.savapage.util.App |
On tab “Arguments” enter the following “Program Arguments”:
${string_prompt}
On tab “Arguments” enter the following “VM arguments”:
-Dserver.home=${project_loc}/../savapage-server/server.home -Dlog4j.configuration=file://${project_loc}/../savapage-server/server.home/lib/log4j.properties
WebServer | Select “savapage-server” from Project Explorer and press F11 |
ClientApp | Select “savapage-client” from Project Explorer and press F11 |
App | Select “savapage-core” from Project Explorer → Run Configurations → Java Application → App → Run |
AppDb | Select “savapage-core” from Project Explorer → Run Configurations → Java Application → AppDb → Run |
Download/install from http://www.squirrelsql.org/
Open the “Drivers” view and configure each driver used.
Apache Derby :
.m2
directory that corresponds with the derby.version
in the savapage-core/pom.xml
file. For example:~/.m2/repository/org/apache/derby/derby/10.14.2.0/derby10.14.2.0.jar
PostgreSQL :
.m2
directory that corresponds with the derby.version
in the savapage-core/pom.xml
file. For example:~/.m2/repository/org/postgresql/postgresql/42.2.14/postgresql-42.2.14.jar
Open the “Aliases” View and “Create a New Alias” for your databases. For example:
Name | Driver | URL | User Name | Password | Auto Logon |
---|---|---|---|---|---|
savapage-dev-derby | Apache Derby Embedded | jdbc:derby:[absolute-path-to]/savapage-server/server.home/data/internal/Derby | Y | ||
savapage-dev-postgres | PostgreSQL | jdbc:postgresql://localhost/your-db-name | user | password | Y |
https://www.savapage.org/download/design/savapage-database-schema-1.10.pdf