You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
At present, GitHub requires authentication even for publicly accessible repositories.
16
16
17
-
The GitHub documentation covering this topic is https://docs.github.com/en/packages/using-github-packages-with-your-projects-ecosystem/configuring-apache-maven-for-use-with-github-packages and will be referred to.
17
+
The GitHub documentation covering this topic is <https://docs.github.com/en/packages/using-github-packages-with-your-projects-ecosystem/configuring-apache-maven-for-use-with-github-packages> and will be referred to.
18
18
19
19
## Getting Started \- GitHub token
20
20
21
21
We are going to create a token. A token is used like a password, and should be kept secret as one. You can revoke a token independently from all other tokens, so we will create a token specifically for this use.
22
22
23
-
1. go to https://github.com/settings/tokens\- you may need to login with a 2nd factor.
24
-
2. click "generate new token".
25
-
- update the Note, something you will remember such as "Maven settings on my laptop"
26
-
- give the token "**read:packages**" scope (permission).
27
-
- Click the "Generate Token" button at the bottom.
28
-
- You will see the new token (random numbers and letters) at the top of the page. Copy it down for the following steps, but **you will not need to save it permanently.**
29
-
- You're done with this page now.
23
+
1. Go to <https://github.com/settings/tokens>\- you may need to login with a 2nd factor.
24
+
1. Click "generate new token".
25
+
- Ensure the correct type of token
26
+
- As of 2025, Github has [2 types of tokens](https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens):
27
+
the older "classic" and the newer "fine-grained"
28
+
- However, [only classic tokens will work to use Github hosted Maven artifacts](https://docs.github.com/en/packages/working-with-a-github-packages-registry/working-with-the-apache-maven-registry),
29
+
even just for reading
30
+
- Update the Note, something you will remember such as "Maven settings on my laptop"
31
+
- Give the token "**read:packages**" scope (permission).
32
+
- Click the "Generate Token" button at the bottom.
33
+
- You will see the new token (random numbers and letters) at the top of the page. Copy it down for the following steps, but **you will not need to save it permanently.**
34
+
- You're done with this page now.
30
35
31
36
## Non\-Eclipse
32
37
33
38
### Installing Maven
34
39
35
-
You can run "mvn \-\-version" from the command line to see if Maven is already installed. If you see "Apache Maven 3…" then you are ready to go.
40
+
You can run `mvn --version` from the command line to see if Maven is already installed. If you see "Apache Maven 3…" then you are ready to go.
36
41
37
42
Otherwise, install the "maven" package from your OS or other package manager, or see instructions under https://maven.apache.org/
38
43
@@ -43,7 +48,7 @@ Otherwise, install the "maven" package from your OS or other package manager, or
43
48
44
49
It might be helpful to refer to the [GitHub documentation](https://docs.github.com/en/packages/using-github-packages-with-your-projects-ecosystem/configuring-apache-maven-for-use-with-github-packages) and the [Maven documentation](https://maven.apache.org/settings.html#Servers) for settings during this step.
45
50
46
-
The file you will be modifying is .m2/settings.xml (the .m2 directory is in your HOME directory, create it if it does not exist).
51
+
The file you will be modifying is `.m2/settings.xml` (the `.m2` directory is in your HOME directory, create it if it does not exist).
47
52
48
53
If the file doesn't exist, create it with this content. If it does exist, add the \<server\> stanza into the \<servers\> section.
0 commit comments