-
Notifications
You must be signed in to change notification settings - Fork 23
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
How to use as <mirrorOf>*</mirrorOf>
?
#83
Comments
Hi Erik, great questions. I've been looking at this, and I have an initial solution, but always open to feedback. First - setting up Maven to mirror everything through AR. Here's a settings file that will do this, but uses basic auth with a short-lived token to authenticate to AR:
This makes use of the fact that Artifact Registry can take a simple username/password, where the username is 'oauth2accesstoken' and the password is a short-lived token. You have to run something like this before the build, to populate the environment variable with your token:
Running your build with these settings will pull all dependencies through the mirror you defined. The downside is that the token will expire after an hour. You can also use this setup to bootstrap your repository with the wagon, which will help this. You can manually install the wagon like this:
This will pull the wagon, and all it's dependencies, via the mirror you configured in the settings file, into the local repository. Make sure you use version 2.2.1, it has slimmed down dependencies compared to the prior versions. Then, you can configure your mirror to use the wagon with two steps:
This file needs to go in your project folder, in
Now, when you build your project, it will load the wagon from the local repo, and then the build will be able to talk to AR using the wagon. The wagon will provide authentication to AR from the environment, instead of using a short lived token. |
This was precisely what I did. I also tried to provide the extension like this In any case, I'm facing this
Maven environment:
|
Hello, do you have any news on this ? |
I'd like to take advantage of the recently released Remote and Virtual repositories features of Artifact Registry in order to make my builds resilient against intermittent connectivity to or throttling by Maven Central.
Currently, even if I forcibly populate my
~/.m2/repository
with the full dependency tree of the plugin, if I then put in a~/.m2/settings.xml
specifyingartifactregistry://...
as a<mirrorOf>*</mirrorOf>
, I get the error below:Can you please provide documentation of how to achieve the following?:
<mirrorOf>*</mirrorOf>
The text was updated successfully, but these errors were encountered: