# Building whois
git clone git@github.com:RIPE-NCC/whois.git
cd whois
mvn clean install
# Goals
There are multiple goals for different types of tests
- unit tests:
mvn clean install
- integration tests:
mvn clean install -Pintegration
- unit + integration tests:
mvn clean install -Pall
- functional tests:
mvn clean install -Pendtoend
# Release
To make a release: mvn clean install -Prelease
To perform a release: mvn clean release:prepare release:perform -Prelease
Performing a release updates version in pom.xml, commits+pushes to git, tried to push artifacts to repo, etc..., whereas making a release will simply make a shaded jar using the current version in pom.xml, nothing else.
The release jar will be created in whois-db/target/whois-db-<pom-xml-version>.jar
# Configuring your IDE
- Install IntelliJ IDEA http://www.jetbrains.com/idea/download/
- Import project
- Point to local whois git repository
- Import using Maven pom
If there are compilation errors, make sure to perform a maven build first, since it will generate required sources:
mvn clean install
# Running whois from within Intellij
Ensure MariaDB and the needed databases are created and populated
- See Getting Started on macOS for installation information.
- See Configure MariaDB for instructions how to create and grant user permission.
- See Installation instructions for instructions on how to create and populate needed databases.
Ensure
whois/tools
directory is populated withhazelcast.xml
file.Ensure a local property is available in
tools
directory. Copywhois/whois-commons/src/test/resources/whois.properties
andwhois/whois-commons/src/test/resources/log4j2.xml
intowhois/tools
directory and ensure the following properties are updated to allow running locally, for example have the following:port.query=1043 port.api=1080 port.nrtm=1081
Also ensure database username and password matches what you have locally. (Normally this should be dbint
with no password)
In
Run/Debug configuration
Set VM options to:-Dwhois.config=./tools/whois-local.properties -Dhazelcast.config=./tools/hazelcast.xml -Dlog4j.configurationFile=file:./tools/log4j2.xml
Run
mvn clean install -Prelease
to ensure property variables set inwhois.version.properties
is available.Start whois by running the Main class
net.ripe.db.whois.db.WhoisServer
# Importing multiple maven sub-projects under one project
Unlike other IDEs, in IntelliJ you can have only one project. However, you can import multiple projects as modules. If you want to import the whois project with its modules and also another maven project, e.g. whois-related follow the steps:
- From the terminal use
mvn clean install
to build both projects. - Create a new Java project (e.g.
root-project
) in IntelliJ using the suggested options from the wizard. - Select Import module, and navigate to whois project pom.
- Check the option to import recursively maven projects.
- Select root-project from the project explorer and repeat step 3 and 4 to import the whois-related project.
# Upgrading IntelliJ
If you upgrade to a newer version of IntelliJ, it will ask you to upgrade your old projects as well.
If there are problems in the project just remove the IntelliJ files and re-import the projects:
- Quit IntelliJ
- Go to the projects folder
- Delete
.idea
folders and*.iml
files - Re-import the projects as described above.
If you want to delete all your IntelliJ project files you can use the following commands:
find . -iname '*.iml' -print0 | xargs -0 rm
find . -type d -name '.idea' -print0 | xargs -0 rm -rf
# Suggested IntelliJ IDE Preferences
- Appearance -> Show tool window bars [on]
- Preferences -> Build, Execution, Deployment -> Compiler -> Compile independent modules in parallel [off] (to prevent "Internal AspectJ compiler error")
- Editor -> General -> Strip spaces on save (All)