Execute the following commands (requires an eduID):
ssh <eduID>@shrek.unideb.hu
pwd # prints the current directory (i.e., the path to your home directory)
mkdir public_html
chmod a+x .
chmod a+rx public_html
Note that the shrek.unideb.hu
server can be accessed over SSH on port 22 (i.e., on the default SSH port) only within the University network. Instead, port 2222 must be used from outside the University network:
ssh <eduID>@shrek.unideb.hu -p 2222
Add the following element to the project/build
element for SSH support:
<extensions>
<extension>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<version>3.5.3</version>
</extension>
</extensions>
Add the following element to the project
element:
<distributionManagement>
<site>
<id>shrek</id>
<url>scp://@shrek.unideb.hu:2222/home/<eduID>/public_html/${project.artifactId}</url>
</site>
</distributionManagement>
The website of the project can be deployed by executing
mvn site-deploy
The command prompts for your password that is shown on the console. Thus, this way of providing your password is not secure.
Moreover, this works only when your username on your local computer is the same as your username on shrek.unideb.hu
(i.e., your eduID). If not, you must also include your eduID in the url
element as follows:
<url>scp://<eduID>@shrek.unideb.hu:2222/home/<eduID>/public_html/${project.artifactId}</url>
Note that you do not have to add your eduID before the @
character when your username and password are stored in the settings.xml
file.
After successful deployment, the website of the project can be found at https://shrek.unideb.hu/~eduID/ and also at https://web.unideb.hu/~eduID/.
Use the ~/.m2/settings.xml
file for storing your password adding the following element to the settings/servers
element:
<server>
<id>shrek</id>
<username>eduID</username>
<password>password</password>
</server>
The password is still provided in clear text, thus, this way of providing your password is not secure.
You should store your password encrypted according to this guide: https://maven.apache.org/guides/mini/guide-encryption.html
Create the ~/.m2/settings-security.xml
file with the following contents:
<settingsSecurity>
<master></master>
</settingsSecurity>
Encrypt an arbitrary chosen master password by executing the following command (emp
stands for encrypt master password):
mvn -emp
Insert the output (i.e., the encrypted master password) to the master
element in the ~/.m2/settings-security.xml
file.
In the following, you can encrypt any password (e.g., your password to shrek.unideb.hu
) using your master password by executing the following command (ep
stands for encrypt password):
mvn -ep
Insert the output (i.e., the encrypted password) to the server/password
element in the ~/.m2/settings.xml
file.