• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

s4u/maven-settings-action: This action setup maven settings.xml

原作者: [db:作者] 来自: 网络 收藏 邀请

开源软件名称(OpenSource Name):

s4u/maven-settings-action

开源软件地址(OpenSource Url):

https://github.com/s4u/maven-settings-action

开源编程语言(OpenSource Language):

JavaScript 99.4%

开源软件介绍(OpenSource Introduction):

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.




鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap