Use of Repositories in Etendo
While Etendo supports any Maven package repository, we will focus on explaining how to configure Etendo's standard repositories credentials.
By default, Etendo Core and extension packages will be downloaded from the GitHub repositories.
Using a Personal Access Token in Etendo Projects
When working with Etendo projects, it is important to have the necessary credentials to access GitHub repositories. One way to do this is by using a Personal Access Token. In this guide, we will walk through the steps of setting up and using a Personal Access Token in an Etendo project.
Generating a Personal Access Token
Along your Etendo License, you will receive an email to join the Etendo Partners Team in GitHub, you have to create or associate a GitHub account with the email invited, and your user will have read access to all the Etendo Repositories.
To generate a Personal Access Token, follow these steps:
- Log in to your GitHub account.
- Click on your profile picture in the top right corner and select Settings.
- Select Developer settings from the left menu and click on Personal access tokens.
In the developer settings page, click on Personal access tokens
Click the Generate new token (classic) button.
Give your token a name and select the permissions you want to grant it. In this case, select read:packages check.
It is strongly recommended to set an expiration date, but it is also posible to set an undefined expiration.
Click Generate token and take note of the token value.
You will not be able to see this value again, so be sure to copy it and keep it in a secure location.
Setting Up the Personal Access Token in Etendo Projects
Once you have generated a Personal Access Token, you will need to set it up in your Etendo project. Follow these steps:
- Open the
gradle.propertiesfile in your project.
Add the following lines to the file, replacing
YOUR_PERSONAL_ACCESS_TOKENwith your actual GitHub username and Personal Access Token:
Using the Personal Access Token in Gradle Tasks
With the Personal Access Token set up in your Etendo project, you can now use it to access GitHub repositories in your Gradle tasks. For example, if you are using the task
to resolve dependencies, it will use your Personal Access Token to authenticate with GitHub.
Revoking a Personal Access Token
If you no longer need a personal access token or believe it has been compromised, you should revoke it immediately. To do so, follow these steps:
- Go to your Settings page in GitHub.
- Click Developer settings in the left-hand sidebar.
- Click Personal access tokens.
- Find the token you want to revoke and click the Revoke button.
- Confirm that you want to revoke the token.
Your token will be immediately invalidated and will no longer work.