Skip to content

Commit 867c258

Browse files
committed
fix: improve local development docs
1 parent ee87120 commit 867c258

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

README.md

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,13 @@ that take 95% of dependencies from Maven Central and left 5% from corporate Code
8686
Come companies opt in to store all dependencies in CodeArtifact with Maven Central as an _upstream_.
8787
In this configuration you would want to set `settings-pluginRepositories` and `settings-repositories` to empty string `""`
8888

89-
## settings.xml for local development
89+
## Local development
9090

9191
Under the hood, this action generates a [settings.xml](./ci.settings.xml) file with CodeArtifact repository and credentials.
9292
Note:
93-
- maven central and its mirror are used as primary and secondary repositories for dependencies and plugins, your company CodeArtifact is in 3rd place
94-
- your company repository id has format `{aws-codeartifact-domain}-{aws-codeartifact-repository}`
93+
- maven central and its mirror are used as primary and secondary repositories for dependencies and plugins, your company CodeArtifact is in 3rd place.
94+
If you use CodeArtifact upstream feature, feel free to remove maven central and its mirror from `repositories` and `pluginRepositories` sections
95+
- your company repository id has format `{aws-codeartifact-domain}-{aws-codeartifact-repository}` like `mycompany-maven`
9596

9697
With this knowledge, you can place a local version of [settings.xml](./local.settings.xml) on developers' machines
9798
to give them read-only access to maven packages in corporate CodeArtifact.
@@ -101,7 +102,9 @@ Host is fixed (after you create CodeArtifact domain), you can place these two li
101102
export AWS_ACCOUNT_DIST=123456789012
102103
export ARTIFACT_STORE_HOST="mycompany-$AWS_ACCOUNT_DIST.d.codeartifact.us-east-1.amazonaws.com"
103104
```
104-
For `ARTIFACT_STORE_TOKEN` you'd need to generate it (at most) once a day with command like this:
105+
CodeArtifact token is _NOT_ long living, max lifetime is 12 hours.
106+
So if you need to resolve new maven dependencies on local dev machine,
107+
you'd need to regenerate `ARTIFACT_STORE_TOKEN` (at most once a day) with command like this:
105108
```shell
106109
TOKEN=$(aws codeartifact get-authorization-token --domain mycompany --query authorizationToken --output text)
107110
export ARTIFACT_STORE_TOKEN=$TOKEN

0 commit comments

Comments
 (0)