-
Fork the ESPD Git repository by clicking on the
Fork
button on the top-right corner of the repository page. Forking a repository allows you to freely experiment with changes without affecting the original project. Most commonly, forks are used to either propose changes to someone else’s project or to use someone else’s project as a starting point for your own idea. -
Create a local clone of your fork
-
On GitHub, navigate to your fork of the ESPD Git repository.
-
Under your repository name, click the
Copy to clipboard
button to clone the URL for the repository. -
Run the
git clone https://github.com/YOUR-USERNAME/espd
command on your computer. Now, you have a local copy of your fork of the ESPD Git repository.
-
-
Configure Git to sync your fork with the original ESPD Git repository. When you fork a project in order to propose changes to the original repository, you can configure Git to pull changes from the original, or upstream, repository into the local clone of your fork.
-
On GitHub, navigate to the ESPD Git repository repository.
-
Under your repository name, click the
Copy to clipboard
button to clone the URL for the repository. -
Change directories to the location of the fork you cloned in the previous step.
-
Execute
git remote -v
to see the current configured remote repository for your fork. -
Type
git remote add upstream https://github.com/ESPD/espd.git
by pasting the URL you copied in Step 2. -
To verify the new upstream repository you’ve specified for your fork, type
git remote -v
again. You should see the URL for your fork asorigin
, and the URL for the original repository asupstream
.
-
$ git remote -v
origin https://github.com/YOUR_USERNAME/YOUR_FORK.git (fetch)
origin https://github.com/YOUR_USERNAME/YOUR_FORK.git (push)
upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git (fetch)
upstream https://github.com/ORIGINAL_OWNER/ORIGINAL_REPOSITORY.git (push)
Now, you can keep your fork synced with the upstream
repository with a few Git commands. For more information,
please see the Syncing a fork page.
Note
|
Quite often people working in a team and using the same repository or upstream prefer different operating systems.
This may result in problems with line endings because Unix, Linux, and OS X use LF and Windows uses CRLF to denote
the end of a line. To have Git solve such problems automatically, you need to set the core.autocrlf attribute to
true on Windows and to input on Linux and OS X. For more details on the meaning of the core.autocrlf attribute,
see the article Dealing with Line Endings. You can change the configuration manually by running
git config --global core.autocrlf true on Windows or git config --global core.autocrlf input on Linux and OS X.
|
Note
|
Each major application version will have a dedicated branch so you can checkout the code for a particular version. |
This section goes into detail about how you can build and run the ESPD application.
The ESPD uses Maven 3 as the primary build system and is structured as a multi-module Maven project.
After getting access to the source code and copying it on your computer, you can now build the project with Maven 3.
-
Change directories to the location of the cloned Git repository on your machine.
-
Perform a
mvn clean package
and now the project dependencies should be downloaded and theexchange-model
,espd-web
andespd-docs
modules should be built.
You can run the ESPD application from your IDE by importing the project as a multi-module Maven project first. You also need to install the Lombok plugin for your particular IDE.
Note
|
Before running the application you need to generate the JAXB classes by invoking a mvn clean package command
and then add the src/main/generated folder on the application classpath of the exchange-model Maven module.
|
The easiest way to start the application is with an embedded Tomcat 8 (default) container by invoking the main
method
from the eu.europa.ec.grow.espd.config.EspdApplication
class in the same way as you would start a normal Java non-web
application.
The application can be deployed as an exploded WAR file on different Servlet 3 containers. For example, you can check the following links on how to deploy it on a Tomcat container:
The fastest way to deploy the application is by using an embedded Tomcat container.
-
Perform a
mvn clean package
from the root folder of the project:-
The build should generate a WAR file at
${baseDir}/espd-web/target/espd-web.war
-
-
Add the following startup parameters to you server:
-
-Dspring.profiles.active=${your desired profile}
specifies the Spring Boot profile to be used -
-Dted.api.user=${your TED user}
where${your TED user}
is replaced by the TED API username -
-Dted.api.password=${your TED password}
where${your TED password}
must be replaced by the TED API password
-
The application can be started with a shell script that can contain the following minimum configuration:
java -Dspring.profiles.active=prod -Xms768m -Xmx768m -jar espd-web.war
Other application parameters can also be specified in exactly the same way, i.e. by prefixing them with a -D
followed
by the name of the parameter. You can consult the application.properties
files for finding out the available options
but please note that the ones specified at start-up have higher precedence than the ones specified in the .properties
files.
Note
|
It is recommended to set up the context path of the application when running in the embedded mode. |
# Context path of the application
server.context-path=/espd
If you want to deploy the application on an external Servlet container, you need to package it as a WAR for the
non-embedded
Maven profile and provide some startup parameters on your server.
-
Perform a
mvn clean package -Pnon-embedded
from the root folder of the project:-
The build should generate a WAR file at
${baseDir}/espd-web/target/espd-web.war
-
-
The other steps are similar to the embedded server deployment mode