All Projects → s4u → maven-settings-action

s4u / maven-settings-action

Licence: MIT License
This action setup maven settings.xml

Programming Languages

javascript
184084 projects - #8 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to maven-settings-action

maven-settings-xml-action
Github Action to create maven settings (~/.m2/settings.xml)
Stars: ✭ 48 (+23.08%)
Mutual labels:  maven, github-actions
metadatamanagement
Metadatamanagement (MDM) - Data Search for Higher Education Research and Science Studies
Stars: ✭ 21 (-46.15%)
Mutual labels:  maven, github-actions
github-create-release-action
Github Action that create Github Release automatically
Stars: ✭ 28 (-28.21%)
Mutual labels:  github-actions
arduino-lint-action
GitHub Actions action to check Arduino projects for problems
Stars: ✭ 20 (-48.72%)
Mutual labels:  github-actions
dockercompose-springboot-mongodb-nginx
Docker Compose with Spring Boot, MongoDB and NGINX
Stars: ✭ 27 (-30.77%)
Mutual labels:  maven
setup-scheme
Github Actions CI / CD setup for Scheme
Stars: ✭ 13 (-66.67%)
Mutual labels:  github-actions
install-swift
GitHub Action to install a version of Swift 🏎
Stars: ✭ 23 (-41.03%)
Mutual labels:  github-actions
gha
🔧 Test your GitHub Actions workflow locally.
Stars: ✭ 53 (+35.9%)
Mutual labels:  github-actions
github-readme-learn-section-notion
Update your github README with data fetched from a notion database
Stars: ✭ 24 (-38.46%)
Mutual labels:  github-actions
ecommerce-microservices-spring-reactive-webflux
E-commerce demo with spring reactive webflux and spring cloud microservice
Stars: ✭ 107 (+174.36%)
Mutual labels:  maven
workable-converter
基于libreoffice实现的文档转换项目,无框架依赖,即插即用
Stars: ✭ 74 (+89.74%)
Mutual labels:  maven
laravel-phpinsights-action
Run PHP Insights in Laravel in Github Actions
Stars: ✭ 17 (-56.41%)
Mutual labels:  github-actions
pipeline-maven-plugin
Pipeline Maven Plugin
Stars: ✭ 50 (+28.21%)
Mutual labels:  maven
maloss
Towards Measuring Supply Chain Attacks on Package Managers for Interpreted Languages
Stars: ✭ 46 (+17.95%)
Mutual labels:  maven
Insan-Kaynaklari-Yonetim-Sistemi
Backendini Javada Frontendini ise React ile yazacağım insan kaynakları yönetim kısmınının backend kısmıdır
Stars: ✭ 14 (-64.1%)
Mutual labels:  maven
profile-readme-stats
Showcase your github stats on your profile README.md
Stars: ✭ 144 (+269.23%)
Mutual labels:  github-actions
bfmvc
模仿springmvc的轻量级web框架,适合学习和搭建小型web项目使用
Stars: ✭ 86 (+120.51%)
Mutual labels:  maven
github-actions-automate-projects
GitHub Actions adding GitHub Issues & Pull requests to the specified GitHub Project column automatically ♻️
Stars: ✭ 44 (+12.82%)
Mutual labels:  github-actions
WorldGuardWrapper
A wrapper for the WorldGuard API that allows plugins to support both v6 and v7 APIs.
Stars: ✭ 21 (-46.15%)
Mutual labels:  maven
Keyist-Ecommerce
🔑 A simple ecommerce site powered with Spring Boot + Angular 10 + Ngrx + OAuth2
Stars: ✭ 220 (+464.1%)
Mutual labels:  maven

maven-settings-action

Test Audit

This action sets up Maven environments for use in GitHub Actions by:

  • create maven settings.xml
  • set interactiveMode to false - useful in CI system
  • after job finish generated settings.xml will be removed to prevent cache or left sensitive data on build system
  • add server to servers with id=github, username=$GITHUB_ACTOR and password=$GITHUB_TOKEN

Contributions

  • Contributions are welcome!
  • Give - if you want to encourage me to work on a project
  • Don't hesitate to create issues for new features you dream of or if you suspect some bug

Project versioning

This project uses Semantic Versioning. We recommended to use the latest and specific release version.

In order to keep your project dependencies up to date you can watch this repository (Releases only) or use automatic tools like Dependabot.

Usage

You can try our action Setup Maven Action for completely maven environment setup.

See action.yml

default settings.xml

steps:
- uses: s4u/[email protected]

settings.xml with servers section

steps:
- uses: s4u/[email protected]
  with:
    servers: '[{"id": "serverId", "username": "username", "password": "password"}]'

Also you can use path argument if your settings.xml is stored in different location.

All server attributes may be specified:

  • id (required)
  • username
  • password
  • privateKey
  • passphrase
  • filePermissions
  • directoryPermissions
  • configuration

Please refer to the servers documentation for more information.

settings.xml with servers section and additional configuration

steps:
- uses: s4u/[email protected]
  with:
    servers: |
      [{
        "id": "serverId",
        "configuration": {
          "item1": "value1",
          "item2": {
            "item21": "value21",
            "item22": "value22"
          }
        }
      }]

result will be:

<server>
    <id>serverId</id>
    <configuration>
      <item1>value1</item1>
      <item2>
        <item21>value21</item21>
        <item22>value22</item22>
      </item1>
    </configuration>
</server></servers>

settings.xml with mirrors section

steps:
- uses: s4u/[email protected]
  with:
    mirrors: '[{"id": "mirrorId", "name": "mirrorName", "mirrorOf": "mirrorOf", "url": "mirrorUrl"}]'

settings.xml with properties

steps:
- uses: s4u/[email protected]
  with:
    properties: '[{"propertyName1": "propertyValue1"}, {"propertyName2": "propertyValue2"}]'

settings.xml with https://oss.sonatype.org/content/repositories/snapshots in repository list

steps:
- uses: s4u/[email protected]
  with:
    sonatypeSnapshots: true

settings.xml with https://repository.apache.org/snapshots/ in repository list

steps:
- uses: s4u/[email protected]
  with:
    apacheSnapshots: true

Do not override existing settings.xml, from version 2.0 file is override by default :

steps:
- uses: s4u/[email protected]
  with:
    override: false

Do not add github to server in settings.xml, by default is added:

steps:
- uses: s4u/[email protected]
  with:
    githubServer: false

settings.xml with special server item configuration for oracle repository Oracle Maven Repository

steps:
- uses: s4u/[email protected]
  with:
    oracleServers: '[{"id": "serverId", "username": "username", "password": "password"}]'

settings.xml with Oracle Maven Repository

steps:
- uses: s4u/[email protected]
  with:
    oracleRepo: true

GitHub actions secrets

It is also possible pass in Github Secrets e.g.

steps:
- uses: s4u/[email protected]
  with:
    servers: |
      [{
          "id": "sonatype-nexus-snapshots",
          "username": "${{ secrets.SONATYPE_USERNAME }}",
          "password": "${{ secrets.SONATYPE_PASSWORD }}"
      }]

Note: secrets are not passed in if the workflow is triggered from a forked repository. See here for further information. This can be avoided by using if triggers on the job e.g. if: github.event_name == 'push'.

Notes

maven-settings-action should be put at the latest position before maven run in order to avoid override setting.xml by another action

  steps:
      - uses: actions/checkout@v2

      - uses: actions/cache@v2
        with:
          path: ~/.m2/repository
          key: maven-${{ hashFiles('**/pom.xml') }}
          restore-keys: maven-

      - uses: actions/setup-java@v1
        with:
          java-version: 8

      - uses: s4u/[email protected]

      - run: mvn verify

License

The scripts and documentation in this project are released under the MIT License.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].