{"id":23756785,"url":"https://github.com/s4u/maven-settings-action","last_synced_at":"2025-05-16T16:08:29.797Z","repository":{"id":36955685,"uuid":"212190217","full_name":"s4u/maven-settings-action","owner":"s4u","description":"This action setup maven settings.xml","archived":false,"fork":false,"pushed_at":"2025-05-05T10:16:19.000Z","size":2483,"stargazers_count":116,"open_issues_count":8,"forks_count":26,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-05-05T19:49:21.810Z","etag":null,"topics":["github-actions","hacktoberfest","maven"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/s4u.png","metadata":{"funding":{"github":"slawekjaranowski"},"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2019-10-01T20:11:01.000Z","updated_at":"2025-04-30T19:30:54.000Z","dependencies_parsed_at":"2023-11-06T10:50:14.382Z","dependency_job_id":"e1e2a809-8f30-42a1-915c-29567b1e1698","html_url":"https://github.com/s4u/maven-settings-action","commit_stats":{"total_commits":346,"total_committers":20,"mean_commits":17.3,"dds":0.3786127167630058,"last_synced_commit":"f972cb7ea0f2241fc14a2721b4a15a2af4e116d3"},"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s4u%2Fmaven-settings-action","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s4u%2Fmaven-settings-action/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s4u%2Fmaven-settings-action/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/s4u%2Fmaven-settings-action/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/s4u","download_url":"https://codeload.github.com/s4u/maven-settings-action/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254564127,"owners_count":22092122,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["github-actions","hacktoberfest","maven"],"created_at":"2024-12-31T19:19:01.751Z","updated_at":"2025-05-16T16:08:29.770Z","avatar_url":"https://github.com/s4u.png","language":"JavaScript","funding_links":["https://github.com/sponsors/slawekjaranowski"],"categories":[],"sub_categories":[],"readme":"# maven-settings-action\n[![Test](https://github.com/s4u/maven-settings-action/workflows/Test/badge.svg)](https://github.com/s4u/maven-settings-action/actions?query=workflow%3ATest)\n[![Audit](https://github.com/s4u/maven-settings-action/workflows/Audit/badge.svg)](https://github.com/s4u/maven-settings-action/actions?query=workflow%3AAudit)\n\n\nThis action sets up Maven environments for use in GitHub Actions by:\n - create maven settings.xml\n - set ```interactiveMode``` to false - useful in CI system\n - after job finish generated settings.xml will be removed to prevent cache or left sensitive data on build system\n - add server to servers with id=github, username=$GITHUB_ACTOR and password=$GITHUB_TOKEN\n\n# Contributions\n- Contributions are welcome!\n- Give :star: - if you want to encourage me to work on a project\n- Don't hesitate to create issues for new features you dream of or if you suspect some bug\n\n# Project versioning\nThis project uses [Semantic Versioning](https://semver.org/).\nWe recommended to use the latest and specific release version.\n\nIn order to keep your project dependencies up to date you can watch this repository *(Releases only)*\nor use automatic tools like [Dependabot](https://docs.github.com/en/code-security/supply-chain-security/keeping-your-dependencies-updated-automatically/about-dependabot-version-updates).\n\n\n # Usage\n\n You can try our action [Setup Maven Action](https://github.com/marketplace/actions/setup-maven-action) for completely maven environment setup.\n\nSee [action.yml](action.yml)\n\n## default ```settings.xml```\n```yml\nsteps:\n- uses: s4u/maven-settings-action@v3.1.0\n```\n\n## ```settings.xml``` with servers section\n\n```yml\nsteps:\n- uses: s4u/maven-settings-action@v3.1.0\n  with:\n    servers: '[{\"id\": \"serverId\", \"username\": \"username\", \"password\": \"password\"}]'\n```\n\nAlso you can use `path` argument if your settings.xml is stored in different location.\n\n\nAll `server` attributes may be specified:\n  * `id` _(required)_\n  * `username`\n  * `password`\n  * `privateKey`\n  * `passphrase`\n  * `filePermissions`\n  * `directoryPermissions`\n  * `configuration`\n\nPlease refer to the [servers](http://maven.apache.org/settings.html#Servers) documentation for more information.\n\n## ```settings.xml``` with servers section and additional configuration\n\n``` yml\nsteps:\n- uses: s4u/maven-settings-action@v3.1.0\n  with:\n    servers: |\n      [{\n        \"id\": \"serverId\",\n        \"configuration\": {\n          \"item1\": \"value1\",\n          \"item2\": {\n            \"item21\": \"value21\",\n            \"item22\": \"value22\"\n          }\n        }\n      }]\n```\n\nresult will be:\n\n```xml\n\u003cservers\u003e\u003cserver\u003e\n    \u003cid\u003eserverId\u003c/id\u003e\n    \u003cconfiguration\u003e\n      \u003citem1\u003evalue1\u003c/item1\u003e\n      \u003citem2\u003e\n        \u003citem21\u003evalue21\u003c/item21\u003e\n        \u003citem22\u003evalue22\u003c/item22\u003e\n      \u003c/item1\u003e\n    \u003c/configuration\u003e\n\u003c/server\u003e\u003c/servers\u003e\n```\n\n\n## ```settings.xml``` with mirrors section\n```yml\nsteps:\n- uses: s4u/maven-settings-action@v3.1.0\n  with:\n    mirrors: '[{\"id\": \"mirrorId\", \"name\": \"mirrorName\", \"mirrorOf\": \"mirrorOf\", \"url\": \"mirrorUrl\"}]'\n```\n\n## ```settings.xml``` with proxies section\n```yml\nstep:\n- uses: s4u/maven-settings-action@v3.1.0\n  with:\n    proxies: '[{\"id\": \"proxyId\", \"active\": \"isActive\", \"protocol\": \"proxyProtocol\", \"host\": \"proxyHost\", \"port\": \"proxyPort\", \"nonProxyHosts\": \"nonProxyHost\", \"user\": \"proxUser\", \"password\": \"proxPassword\"}]'\n```\nNote: Authentication details are optional.\n\n## ```settings.xml``` with properties\n```yml\nsteps:\n- uses: s4u/maven-settings-action@v3.1.0\n  with:\n    properties: '[{\"propertyName1\": \"propertyValue1\"}, {\"propertyName2\": \"propertyValue2\"}]'\n```\n\n## ```settings.xml``` with https://oss.sonatype.org/content/repositories/snapshots in repository list\n\n```yml\nsteps:\n- uses: s4u/maven-settings-action@v3.1.0\n  with:\n    sonatypeSnapshots: true\n```\n\n## ```settings.xml``` with https://repository.apache.org/snapshots/ in repository list\n\n```yml\nsteps:\n- uses: s4u/maven-settings-action@v3.1.0\n  with:\n    apacheSnapshots: true\n```\n\n## Do not override existing ```settings.xml```, from version **2.0** file is override by default :\n```yml\nsteps:\n- uses: s4u/maven-settings-action@v3.1.0\n  with:\n    override: false\n```\n\n## Do not add github to server in ```settings.xml```, by default is added:\n```yml\nsteps:\n- uses: s4u/maven-settings-action@v3.1.0\n  with:\n    githubServer: false\n```\n\n## ```settings.xml``` with special server item configuration for oracle repository [Oracle Maven Repository](https://docs.oracle.com/middleware/1213/core/MAVEN/config_maven_repo.htm#MAVEN9015)\n\n```yml\nsteps:\n- uses: s4u/maven-settings-action@v3.1.0\n  with:\n    oracleServers: '[{\"id\": \"serverId\", \"username\": \"username\", \"password\": \"password\"}]'\n```\n\n## ```settings.xml``` with [Oracle Maven Repository](https://docs.oracle.com/middleware/1213/core/MAVEN/config_maven_repo.htm#MAVEN9017)\n```yml\nsteps:\n- uses: s4u/maven-settings-action@v3.1.0\n  with:\n    oracleRepo: true\n```\n\n## ```settings.xml``` with custom repositories\n```yml\nsteps:\n- uses: s4u/maven-settings-action@v3.1.0\n  with:\n    repositories: '[{\"id\":\"repoId\",\"name\":\"repoName\",\"url\":\"url\",\"snapshots\":{\"enabled\":true}}]'\n```\n\n## ```settings.xml``` with custom plugin repositories\n```yml\nsteps:\n- uses: s4u/maven-settings-action@v3.1.0\n  with:\n    pluginRepositories: '[{\"id\":\"repoId\",\"name\":\"repoName\",\"url\":\"url\",\"snapshots\":{\"enabled\":true}}]'\n```\n\n\n## GitHub actions secrets\n\nIt is also possible pass in Github Secrets e.g.\n\n``` yml\nsteps:\n- uses: s4u/maven-settings-action@v3.1.0\n  with:\n    servers: |\n      [{\n          \"id\": \"sonatype-nexus-snapshots\",\n          \"username\": \"${{ secrets.SONATYPE_USERNAME }}\",\n          \"password\": \"${{ secrets.SONATYPE_PASSWORD }}\"\n      }]\n```\n\n**Note**: secrets are *not* passed in if the workflow is triggered from a forked repository. See [here](https://docs.github.com/en/free-pro-team@latest/actions/reference/encrypted-secrets#using-encrypted-secrets-in-a-workflow) for further information. This can be avoided by using `if` triggers on the job e.g. `if: github.event_name == 'push'`.\n\n# Notes\n\n**maven-settings-action** should be put at the latest position before maven run in order to avoid override ```setting.xml``` by another action\n\n```yml\n  steps:\n      - uses: actions/checkout@v2\n\n      - uses: actions/cache@v2\n        with:\n          path: ~/.m2/repository\n          key: maven-${{ hashFiles('**/pom.xml') }}\n          restore-keys: maven-\n\n      - uses: actions/setup-java@v1\n        with:\n          java-version: 8\n\n      - uses: s4u/maven-settings-action@v3.1.0\n\n      - run: mvn verify\n```\n\n# License\n\nThe scripts and documentation in this project are released under the [MIT License](LICENSE).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fs4u%2Fmaven-settings-action","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fs4u%2Fmaven-settings-action","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fs4u%2Fmaven-settings-action/lists"}