-
Notifications
You must be signed in to change notification settings - Fork 8
feat: resolve repository with akka-token variable #797
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
27ab2e0
to
021affa
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea here is that the CLI could take care of the token and add it to ~/.mvn/maven.config
.
This file will have the following content:
=❯ cat ~/.mvn/maven.config
-Dakka-token=user-token-goes-here
It's is automatically loaded by maven and the variables are passed to the build. Therefore, the ${akka-token}
variable is resolved.
We should find a way to print a nice message in case it's missing, for example.
@@ -54,22 +54,23 @@ | |||
<maven-failsafe-plugin.version>3.1.2</maven-failsafe-plugin.version> | |||
<maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version> | |||
<maven-deploy-plugin.version>3.1.1</maven-deploy-plugin.version> | |||
|
|||
<akka-token>invalid-token</akka-token> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@sebastian-alfers / @JustinPihony, would it be possible to fail the download with a clear message in case the passed token is invalid-token
?
021affa
to
7a2fe4c
Compare
<activeByDefault>true</activeByDefault> | ||
</activation> | ||
<properties> | ||
<akka-secure-repo>https://repo.akka.io/maven/github_actions</akka-secure-repo> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Most info is in the parent pom. Therefore the settings.xml that we use in the build can define only the repo url.
Draft: just exploring some ideas to easy the the token retrieval.
Some extra information that will help understand how this will work.
The precedence order to resolve properties is the following:
~/.mvn/maven.config
)This PR is changing the parent pom to have the following:
If no changes are made, the resulting URL will be
https://repo.akka.io/invalid-token/secure
. The most effective solution is to detect this scenario and display a clear, informative message to the user.When a user obtains a token via the CLI, it will be added to their
~/.mvn/maven.config
as-Dakka-token=user-token
. Alternatively, users can choose to add the token directly to theirsettings.xml
if they prefer.This approach works well for us because it centralizes the repository configuration in the parent POM, giving us greater control. For instance, if we need to migrate the repository URL, we can simply update the parent POM, rather than asking users to modify their settings.xml files individually.