- Download Eclipse Oxygen: Java EE:
- either get the portable version here: https://www.eclipse.org/downloads/eclipse-packages/ » Eclipse IDE for Java EE Developers » 64bit.
- or use this direct link to the currently latest zip: https://www.eclipse.org/downloads/download.php?file=/technology/epp/downloads/release/oxygen/1a/eclipse-jee-oxygen-1a-win32-x86_64.zip
- Install/unzip eclipse to a folder (e.g.
C:\DATA\DEV\...
) - Start Eclipse
- Install Spring: Help >> Eclipse Marketplace >> Search and install
Spring Tool Suite
- Restart Eclipse
- Add
-clean -Xms512m -Xmx1024m
to the.exe
shortcut - Clone project with git (e.g. to
C:\DATA\DEV\workspace
). It’s easier not to do this in eclipse, but with the git bash or gui) - Import project in eclipse: File >> Import >> Existing Maven Project >> point to
pom.xml
- Deactivate "autobuild": Window >> Preferences >> General >> Workspace >> uncheck "Build automatically"
- Ideykeyscheme: https://code.google.com/archive/p/ideakeyscheme/
- Add jar file to
eclipse\plugins
folder. - Restart Eclipse.
- Open Window >> Preferences >> General >> Keys and select the scheme "Intellij Idea".
- Add jar file to
- Change "spaces for tabs" settings:
- General: Window >> Preferences >> General >> Editors >> Text Editors >> Check
Insert spaces for tabs
- JavaScript: Window >> Preferences >> Javascript >> Code Style >> Formatter >> Edit >> Indentation >> Tab policy >> choose
spaces only
- Set
Indentation size
+Tab size
:2
- Rename the formatter settings profile to save it
- Set
- General: Window >> Preferences >> General >> Editors >> Text Editors >> Check
- Set maven profiles: right-click the webofneeds project in the package explorer >> Maven >> Select Maven Profiles. check
skip-tests
- If you develop on Windows you will need to setup
node
swindows-build-tools
(see this guide)
- Create Server: File >> New >> Other >> Server
- Choose Tomcat, then press "next" (not "finish")
- Make sure you use a Java 8 JDK or JRE, not java 9, or tomcat will not start up and throw a JAXB-related exception.
- Add node and owner and click finish
- If you do not have the options to add the owner and node application to the tomcat (also accessible via Server >> [your tomcat server] >> Add and Remove), something went wrong.
- Maybe you did not install eclipse for Java EE. Check Help >> About Eclipse. If it does not say 'Eclipse Java EE IDE for Web Developers.', the easiest is to download and install Eclipse for Java EE.
- Maybe the import of the webofneeds maven project somehow did not work properly. Delete all imported projects (without deleting the sources), then import again (File >> Import... >> Maven >> Existing Maven Projects )
- If you do not have the options to add the owner and node application to the tomcat (also accessible via Server >> [your tomcat server] >> Add and Remove), something went wrong.
- Add Server view: Window >> Show View >> Server
- Change server.xml: In Project Explorer >> Server >> "Your Server" >> open
server.xml
and add
<Service name="Catalina">
...
<Connector
SSLCertificateFile="<PATH TO SERVER CERTS>/won-server-certs/t-cert.pem"
SSLCertificateKeyFile="<PATH TO SERVER CERTS>/won-server-certs/t-key.pem"
SSLEnabled="true"
SSLPassword="changeit"
SSLVerifyClient="optionalNoCA"
SSLVerifyDepth="2"
acceptCount="100"
clientAuth="false"
compressableMimeType="
text/html,
text/xml,
text/plain,
text/css,
text/javascript,
application/javascript,
application/x-font-ttf,
image/svg+xml,
text/turtle,
application/rdf+xml,
application/x-turtle,
text/rdf+n3,
application/json,
application/trig,
application/ld+json,
application/n-quads"
compression="on"
disableUploadTimeout="true"
enableLookups="true"
keystoreFile="<PATH TO CLIENT CERTS>\client-certs\owner-keys.jks"
keystorePass="temp"
maxPostSize="5242880000"
maxSpareThreads="75"
maxThreads="200"
minSpareThreads="5"
port="8443"
scheme="https"
secure="true"
sslProtocol="TLS"
/>
...
</Service>
NOTE: replace with your own certificate path for server and client certificate locations if necessary
- Edit server configuration: DoubleClick the server in the "Server View" and select:
- Open launch configuration >> (x)= Arguments >> VM arguments
- append the following, replacing the placeholders
<PROJECT_FOLDER>
to the webofneeds project location and the<TOMCAT_FOLDER>
to the installation directory of your tomcat:-Djava.library.path="<TOMCAT_FOLDER>\bin" -XX:PermSize=512m -XX:MaxPermSize=512m -DWON_CONFIG_DIR="<PROJECT_FOLDER>\webofneeds\conf.local" -Dlogback.configurationFile="<PROJECT_FOLDER>\webofneeds\conf.local\logback.xml"
- append the following, replacing the placeholders
- Add the JSTL jar to your tomcat's classpath libs (or tomcat cannot be run in
Serve modules without publishing
mode, seeServer Options
below):- Open Launch Configuration >> Classpath >> User Entries >> Add External JARs ...
- Navigate to your maven repository (default location: [user home].m2\repository; if it's not there, look into [user home].m2\settings.xml)
- find javax\servlet\jstl\1.2\jstl-1.2.jar
- if you don't find it
- build the whole project with
mvn install -Dmaven.test.skip=true
- try again
- build the whole project with
- Server Locations: Use Workspace Metadata
- Server Options
- Serve modules without publishing (allows for instant effect of changes)
- Publish module contexts to separate XML files
- Modules auto reload by default
- Enable security
- Enable tomcat logging
- Publishing: Never publish automatically
- Timeouts: i.e. 180 + 30
- Ports: The ports should be shown for HTTP + SSL
- Suppress unnecessary tag library (TLD) scans: (speeds up server startup)
- In the eclipse navigator view, open Servers >> Tomcat 8.0 (your server config)
- edit
catalina.properties
- replace the value of the multi-line(!) property
tomcat.util.scan.StandardJarScanFilter.jarsToSkip
such that the line reads,tomcat.util.scan.StandardJarScanFilter.jarsToSkip=*.jar
- replace the value of the multi-line(!) property
tomcat.util.scan.StandardJarScanFilter.jarsToScan
such that the line reads,tomcat.util.scan.StandardJarScanFilter.jarsToScan=jstl-1.2.jar
- Allow both webapps (owner-webapp and node-webapp) to start simultaneously: (speeds up server startup)
- In the eclipse navigator view, open Servers >> Tomcat 8.0 (your server config)
- edit
server.xml
- find the xml element
<Host appBase="webapps" ...
and add the xml attributestartStopThreads="2"
- Open launch configuration >> (x)= Arguments >> VM arguments
- Follow instructions on https://github.com/researchstudio-sat/webofneeds/blob/5dc0db3747c201a87d94621453b8b898a34e7fc4/documentation/installation-cryptographic-keys-and-certificates.md and make sure that you have the
tcnative-1.dll
in your tomcat'sbin/
-folder!, and that you correctly point to it with the-Djava.library.path
variable (Step 7). Otherwise you will getInvalidKeystoreFormatException
s at server startup and an info message which saysThe APR based Apache Tomcat Native library which allows optimal performance in production environments was not found on the java.library.path
=> following path where to put the .dll - Add the bouncy castle libraries
bcpkix-jdk15on-1.52.jar
andbcprov-jdk15on-1.52.jar
your tomcat'slib
folder. The two jars can be found in the[your m2 repo]/org/bouncycastle
folder. Hint: Do not add the bouncycastle libraries to the "Installed JRE". - Start server
- Run the gulpfile outside eclipse:
npm run build
inwepapp
, refresh thewon-owner-webapp
in eclipse (F5), click on the server –> "Publish"