https://github.com/itzg/artifactory-settings-gen
https://github.com/itzg/artifactory-settings-gen
Last synced: 9 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/itzg/artifactory-settings-gen
- Owner: itzg
- Created: 2020-05-14T19:09:06.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2020-05-14T19:09:26.000Z (about 6 years ago)
- Last Synced: 2025-01-14T10:17:54.884Z (over 1 year ago)
- Language: Java
- Size: 53.7 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
A small, CLI-style Spring Boot application that sets up a Maven settings.xml file for Artifactory access.
`ApplicationProperties` declares properties, prefixed with `artifactory.`, that specify how to access Artifactory and a project name referenced in the generated `settings.xml`:
- `artifactory.base-url` : the base URL of Artifactory without the `/artifactory` path
- `artifactory.project` : not actually an Artifactory parameter, but rather an identifier used in the generated `settings.xml`
- `artifactory.username`
- `artifactory.password`
It is recommended to place the first two in a file `application.yml` in the current directory:
```yaml
artifactory:
baseUrl: http://...
project: yours
```
The username and password should be passed on the command-line to keep them as secure as possible. After bulding the application jar with:
```
./mwvnw package
```
You can run it as:
```
java -jar target/artifactory-settings-gen-*.jar --artifactory.username=... --artifactory.password=...
```
The entrypoint and main part of the application is in `ArtifactoryInitApplication` where it
- contacts artifactory to grab the encrypted password for the given user
- populates that and the project name into the mustache template `settings-xml.mustache`, in `src/main/resources/templates`
- writes the file `settings.xml` in the directory `$HOME/.m2` or outputs the content if that file already exists