Onboarding New Developers

This is a short guide of what to do if you are new in the team.

In a brief

What you’ll need

  • A favourite Git client

  • Java

  • Maven

  • An IDE of your choice - either IntelliJIDEA or Eclipse

Install a Git client

Download the latest version of any Git client and install it.

Clone the project

The project resides on GitHub, so issue the following command to clone it:

git clone https://github.com/nemesis-software/nemesis-platform.git

Install Java

At the moment, the Nemesis platform requires version of the JDK at least 1.8.0, so go to the Oracle website and download the latest version of the JDK. Please note that we use maven-enforcer-plugin, so an older version will simply not build the project.

Install Maven

The platform needs Maven, in order to build the project. Required version is at least 3.0.0-alpha-1, so go to the Apache Maven website and download it. Please note that we use maven-enforcer-plugin, so an older version will simply not build the project.

Configure Maven

To be able to run build the consoles, you need access to the Nemesis company repository. What you need to do is change your settings.xml and add the server configuration with the Nemesis username and the password you have. The settings.xml is located in ~/.m2/ on Linux, and C:\Users\[User]\.m2\ on Windows.

<?xml version="1.0" encoding="UTF-8"?>
<settings>
        <servers>
                <server>
                  <id>nemesis-repository</id>
                  <username>admin</username>
                  <password>YOUR_PASSWORD_HERE</password>
                </server>
                <server>
                  <id>nemesis-repository-releases</id>
                  <username>admin</username>
                  <password>YOUR_PASSWORD_HERE</password>
                </server>
                <server>
                  <id>nemesis-repository-snapshots</id>
                  <username>admin</username>
                  <password>YOUR_PASSWORD_HERE</password>
                </server>
        </servers>
</settings>

Install IntelliJIDEA or Eclipse

Install the latest version of IntelliJIDEA or Eclipse. Please note that the project files are already in the source repostitory, so it should be straightforward import of the project.

  • For IntelliJIDEA the recomended way is to import only one project;

  • For Eclipse the recommended way is to import every module as a separate project;

Configure IntelliJIDEA

Please find here the official Nemesis formatter for IntelliJIDEA and use it on your project. The formatter needs to be copied in your ~/.IntelliJIdea14/config/codestyles/ folder. After that restart the IDE and go to FileSettingsEditorCodestyle and select Nemesis from the dropdown menu. Then, go to FileSettingsEditorCopyright and create a new copyright profile with the following content:

nemesis Platform - NExt-generation Multichannel E-commerce SYStem

Copyright (c) 2010 - $today.year nemesis
All rights reserved.

This software is the confidential and proprietary information of nemesis
("Confidential Information"). You shall not disclose such Confidential
Information and shall use it only in accordance with the terms of the
license agreement you entered into with nemesis.

You can also create a file and code template to pre-populate your javadoc comments. To do that go to FileSettingsEditorFile and code templates and click on the Includes tab to fill the style of the javadoc:

/**
 *
 * @author Yourfirstname Yourlastname
 * @since 0.7
 */
Please make sure you use the latest unreleased version of the project.

Configure Eclipse

Please find here the official Nemesis formatter for Eclipse and use it on your project. Then go to WindowPreferencesJavaCode StyleCode Templates. Edit CommentsFiles and set following content:

/*
 * nemesis Platform - NExt-generation Multichannel E-commerce SYStem
 *
 * Copyright (c) 2010 - ${year} nemesis
 * All rights reserved.
 *
 * This software is the confidential and proprietary information of nemesis
 * ("Confidential Information"). You shall not disclose such Confidential
 * Information and shall use it only in accordance with the terms of the
 * license agreement you entered into with nemesis.
 */

Edit CommentTypes and set the following content:

/**
 *
 * @author Yourfirstname Yourlastname
 * @since 0.6
 */

Make sure Automatically add comments for new methods and types is checked.

Build the project

To build the project simply run

mvn clean install

from the top of the project.

Please be patient - the first build might take even an hour, as Maven is downloading all the missing artifacts. Subsequent builds, however, should build relatively fast.

The above command will not execute any integration tests. If you want to execute the integration tests you will need to start maven with the test profile.

mvn clean install -Ptest

Code of conduct

If you installed the above Eclipse or IntelliJIdea formatters, this should be enough to keep the code format consistent. However, there are a few more things, related to Git, you need to consider.

As a first-time setup, please specify your name and email:

$ git config --global user.name "John Doe"
$ git config --global user.email [email protected]

If you happen to be in a situation where you have committed changes, but you can’t push, because someone else has done that before you, please consider one of the two approaches:

  • Either use git stash, then git pull and then git stash pop to propagate your changes.

  • Or use git pull --rebase to apply first the remote changes and then yours on top of that.

Whenever you commit, please follow the Spring approach for commit messages. Recommended are a header, a body that explains the problem and the changes. Last but not least, if you close an issue in GitHub, add a line in your commit message that indicates that (in the form of Close nemesis-software/nemesis-platform#123). An example of a good commit message is:

Infrastructure for generated column values.
Jpa does not specify a way to mark a column as generated (in vm or db) if it is not `@Id`.
We can now register custom 'generator' for any column and this approach is used for uid.
Previously the uid generation was responsibility of the entity service, now this logic is in a `@EntityListener`,

Also added new definition for sequences, That can be extended (like OrderUidSequenceDefinition does) in order
 to have sequence(tables) ddl in sql scripts.

Fixes nemesis-software/nemesis-platform#79