mirror of
https://github.com/s4u/maven-settings-action.git
synced 2026-02-13 00:05:25 +08:00
Compare commits
35 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 63ea49dafa | |||
| 64c06afaca | |||
| b818438be1 | |||
| 10967cd2f2 | |||
| d0b8b534b3 | |||
| 1b34539e65 | |||
| 79bc1c28ad | |||
| f2d19d8a3c | |||
| d38ae3dd0c | |||
| 1a566d6b1a | |||
| 68c0f5968a | |||
| fa170c9efb | |||
| b8e6d4c5c1 | |||
| c79b8c8bae | |||
| 19aa5326f7 | |||
| e754a0a431 | |||
| 79b590b1fa | |||
| 6e3efd3238 | |||
| c920943d3e | |||
| 6fd54e3151 | |||
| 2d2d5e94f6 | |||
| 42f81f61fc | |||
| c7c8114a65 | |||
| 5db73d2f08 | |||
| 8a73d2812b | |||
| 8800b3c2a1 | |||
| c56767da71 | |||
| fa7733af88 | |||
| 505f1cce2c | |||
| 1951d18467 | |||
| 19102415df | |||
| df80e35e53 | |||
| c17275b0ee | |||
| 9c1c20e659 | |||
| 113dd73fa6 |
27
.github/workflows/audit.yml
vendored
Normal file
27
.github/workflows/audit.yml
vendored
Normal file
@ -0,0 +1,27 @@
|
||||
name: "Audit"
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'dependabot/*'
|
||||
schedule:
|
||||
- cron: '09 22 * * *'
|
||||
|
||||
jobs:
|
||||
test:
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ubuntu-latest, windows-latest, macOS-latest]
|
||||
fail-fast: false
|
||||
runs-on: ${{ matrix.os }}
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: '12.x'
|
||||
|
||||
- run: npm version
|
||||
- run: npm ci
|
||||
- run: npm audit
|
||||
14
.github/workflows/test.yml
vendored
14
.github/workflows/test.yml
vendored
@ -1,7 +1,9 @@
|
||||
name: "Test Action"
|
||||
name: "Test"
|
||||
on:
|
||||
pull_request:
|
||||
push:
|
||||
branches-ignore:
|
||||
- 'dependabot/*'
|
||||
schedule:
|
||||
- cron: '22 22 * * 5'
|
||||
|
||||
@ -15,18 +17,24 @@ jobs:
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v1
|
||||
|
||||
- uses: actions/setup-node@v1
|
||||
with:
|
||||
node-version: '12.x'
|
||||
|
||||
- uses: actions/setup-java@v1
|
||||
with:
|
||||
java-version: '1.8'
|
||||
|
||||
- run: npm version
|
||||
- run: npm ci
|
||||
- run: npm audit
|
||||
- run: npm test
|
||||
|
||||
- uses: ./
|
||||
with:
|
||||
servers: '[{"id": "serverId", "username": "username", "password": "password"}]'
|
||||
servers: '[{"id": "serverId", "username": "username", "password": "password"}]'
|
||||
properties: '[{"prop1": "value1"}, {"prop2": "value2"}]'
|
||||
mirrors: '[{"id": "mirrorId", "name": "mirrorName", "mirrorOf": "mirrorOf", "url": "mirrorUrl"}]'
|
||||
sonatypeSnapshots: true
|
||||
|
||||
- run: cat ~/.m2/settings.xml
|
||||
|
||||
1
.gitignore
vendored
1
.gitignore
vendored
@ -3,6 +3,7 @@
|
||||
|
||||
# Editors
|
||||
.vscode
|
||||
.idea
|
||||
|
||||
# Logs
|
||||
logs
|
||||
|
||||
53
README.md
53
README.md
@ -1,10 +1,26 @@
|
||||
# maven-settings-action
|
||||
[](https://github.com/s4u/maven-settings-action/actions)
|
||||
[](https://github.com/s4u/maven-settings-action/actions?query=workflow%3ATest)
|
||||
[](https://github.com/s4u/maven-settings-action/actions?query=workflow%3AAudit)
|
||||
|
||||
|
||||
This action setup maven environment for use in action 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 :star: - if you want to encourage me to work on a project
|
||||
- Don't hesitate create issue for new feature you dream of or if you suspect some bug
|
||||
|
||||
# Project versioning
|
||||
Project use [Semantic Versioning](https://semver.org/).
|
||||
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](https://dependabot.com/).
|
||||
|
||||
|
||||
# Usage
|
||||
See [action.yml](action.yml)
|
||||
@ -12,21 +28,29 @@ See [action.yml](action.yml)
|
||||
Create default ```settings.xml```:
|
||||
```yml
|
||||
steps:
|
||||
- uses: s4u/maven-settings-action@v1
|
||||
- uses: s4u/maven-settings-action@v2
|
||||
```
|
||||
|
||||
Create ```settings.xml``` with server section:
|
||||
Create ```settings.xml``` with servers section:
|
||||
```yml
|
||||
steps:
|
||||
- uses: s4u/maven-settings-action@v1
|
||||
- uses: s4u/maven-settings-action@v2
|
||||
with:
|
||||
servers: '[{"id": "serverId", "username": "username", "password": "password"}]'
|
||||
```
|
||||
|
||||
Create ```settings.xml``` with mirrors section:
|
||||
```yml
|
||||
steps:
|
||||
- uses: s4u/maven-settings-action@v2
|
||||
with:
|
||||
mirrors: '[{"id": "mirrorId", "name": "mirrorName", "mirrorOf": "mirrorOf", "url": "mirrorUrl"}]'
|
||||
```
|
||||
|
||||
Create ```settings.xml``` with maven properties:
|
||||
```yml
|
||||
steps:
|
||||
- uses: s4u/maven-settings-action@v1
|
||||
- uses: s4u/maven-settings-action@v2
|
||||
with:
|
||||
properties: '[{"propertyName1": "propertyValue1"}, {"propertyName2": "propertyValue2"}]'
|
||||
```
|
||||
@ -34,24 +58,27 @@ steps:
|
||||
Create ```settings.xml``` with https://oss.sonatype.org/content/repositories/snapshots in repository list
|
||||
```yml
|
||||
steps:
|
||||
- uses: s4u/maven-settings-action@v1
|
||||
- uses: s4u/maven-settings-action@v2
|
||||
with:
|
||||
sonatypeSnapshots: true
|
||||
```
|
||||
|
||||
Override existing existing ```settings.xml```:
|
||||
Do not override existing ```settings.xml```, from version 2.0 file is override by default :
|
||||
```yml
|
||||
steps:
|
||||
- uses: s4u/maven-settings-action@v1
|
||||
- uses: s4u/maven-settings-action@v2
|
||||
with:
|
||||
override: true
|
||||
override: false
|
||||
```
|
||||
|
||||
Do not add github to server in ```settings.xml```, by default is added:
|
||||
```yml
|
||||
steps:
|
||||
- uses: s4u/maven-settings-action@v2
|
||||
with:
|
||||
githubServer: false
|
||||
```
|
||||
|
||||
# License
|
||||
|
||||
The scripts and documentation in this project are released under the [MIT License](LICENSE)
|
||||
|
||||
# Contributions
|
||||
|
||||
Contributions are welcome!
|
||||
|
||||
10
action.yml
10
action.yml
@ -9,6 +9,9 @@ inputs:
|
||||
servers:
|
||||
description: 'servers definition in joson array, eg: [{"id": "serverId", "username": "username", "password": "password"}]'
|
||||
required: false
|
||||
mirrors:
|
||||
description: 'mirrors definition in json array, eg: [{"id": "id", "name": "name", "mirrorOf": "mirrorOf", "url": "url"}]'
|
||||
required: false
|
||||
properties:
|
||||
description: 'json array with properties, eg [{"propertyName1": "propertyValue1"}, {"propertyName2": "propertyValue2"}]'
|
||||
required: false
|
||||
@ -18,8 +21,13 @@ inputs:
|
||||
required: false
|
||||
override:
|
||||
description: 'override existing settings.xml file'
|
||||
default: "false"
|
||||
default: "true"
|
||||
required: false
|
||||
githubServer:
|
||||
description: 'add to settings.xml servers server-id: github; username=$GITHUB_ACTOR and password=$GITHUB_TOKEN'
|
||||
default: "true"
|
||||
required: false
|
||||
|
||||
|
||||
|
||||
runs:
|
||||
|
||||
6
node_modules/@actions/core/README.md
generated
vendored
6
node_modules/@actions/core/README.md
generated
vendored
@ -82,6 +82,12 @@ try {
|
||||
core.warning('myInput was not set');
|
||||
}
|
||||
|
||||
if (core.isDebug()) {
|
||||
// curl -v https://github.com
|
||||
} else {
|
||||
// curl https://github.com
|
||||
}
|
||||
|
||||
// Do stuff
|
||||
}
|
||||
catch (err) {
|
||||
|
||||
4
node_modules/@actions/core/lib/core.d.ts
generated
vendored
4
node_modules/@actions/core/lib/core.d.ts
generated
vendored
@ -55,6 +55,10 @@ export declare function setOutput(name: string, value: string): void;
|
||||
* @param message add error issue message
|
||||
*/
|
||||
export declare function setFailed(message: string): void;
|
||||
/**
|
||||
* Gets whether Actions Step Debug is on or not
|
||||
*/
|
||||
export declare function isDebug(): boolean;
|
||||
/**
|
||||
* Writes debug message to user log
|
||||
* @param message debug message
|
||||
|
||||
7
node_modules/@actions/core/lib/core.js
generated
vendored
7
node_modules/@actions/core/lib/core.js
generated
vendored
@ -104,6 +104,13 @@ exports.setFailed = setFailed;
|
||||
//-----------------------------------------------------------------------
|
||||
// Logging Commands
|
||||
//-----------------------------------------------------------------------
|
||||
/**
|
||||
* Gets whether Actions Step Debug is on or not
|
||||
*/
|
||||
function isDebug() {
|
||||
return process.env['RUNNER_DEBUG'] === '1';
|
||||
}
|
||||
exports.isDebug = isDebug;
|
||||
/**
|
||||
* Writes debug message to user log
|
||||
* @param message debug message
|
||||
|
||||
2
node_modules/@actions/core/lib/core.js.map
generated
vendored
2
node_modules/@actions/core/lib/core.js.map
generated
vendored
@ -1 +1 @@
|
||||
{"version":3,"file":"core.js","sourceRoot":"","sources":["../src/core.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,uCAA6C;AAE7C,uCAAwB;AACxB,2CAA4B;AAU5B;;GAEG;AACH,IAAY,QAUX;AAVD,WAAY,QAAQ;IAClB;;OAEG;IACH,6CAAW,CAAA;IAEX;;OAEG;IACH,6CAAW,CAAA;AACb,CAAC,EAVW,QAAQ,GAAR,gBAAQ,KAAR,gBAAQ,QAUnB;AAED,yEAAyE;AACzE,YAAY;AACZ,yEAAyE;AAEzE;;;;GAIG;AACH,SAAgB,cAAc,CAAC,IAAY,EAAE,GAAW;IACtD,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,GAAG,CAAA;IACvB,sBAAY,CAAC,SAAS,EAAE,EAAC,IAAI,EAAC,EAAE,GAAG,CAAC,CAAA;AACtC,CAAC;AAHD,wCAGC;AAED;;;GAGG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G,EAAE,CAAC,GAAG,CAAC,CAAA;AACxC,CAAC;AAFD,oBAEC;AAED;;;;;;GAMG;AACH,SAAgB,UAAU,CAAC,IAAY;IACrC,eAAK,CAAC,OAAO,EAAE,IAAI,CAAC,CAAA;AACtB,CAAC;AAFD,gCAEC;AAED;;GAEG;AACH,SAAgB,QAAQ;IACtB,eAAK,CAAC,UAAU,CAAC,CAAA;AACnB,CAAC;AAFD,4BAEC;AAED;;;;;;;GAOG;AACH,SAAsB,KAAK,CAAI,IAAY,EAAE,EAAoB;;QAC/D,UAAU,CAAC,IAAI,CAAC,CAAA;QAEhB,IAAI,MAAS,CAAA;QAEb,IAAI;YACF,MAAM,GAAG,MAAM,EAAE,EAAE,CAAA;SACpB;gBAAS;YACR,QAAQ,EAAE,CAAA;SACX;QAED,OAAO,MAAM,CAAA;IACf,CAAC;CAAA;AAZD,sBAYC;AAED,yEAAyE;AACzE,uBAAuB;AACvB,yEAAyE;AAEzE;;;;;GAKG;AACH,SAAgB,SAAS,CAAC,IAAY,EAAE,KAAa;IACnD,sBAAY,CAAC,YAAY,EAAE,EAAC,IAAI,EAAC,EAAE,KAAK,CAAC,CAAA;AAC3C,CAAC;AAFD,8BAEC;AAED;;;;;GAKG;AACH,SAAgB,QAAQ,CAAC,IAAY;IACnC,OAAO,OAAO,CAAC,GAAG,CAAC,SAAS,IAAI,EAAE,CAAC,IAAI,EAAE,CAAA;AAC3C,CAAC;AAFD,4BAEC"}
|
||||
69
node_modules/@actions/core/package.json
generated
vendored
69
node_modules/@actions/core/package.json
generated
vendored
@ -1,40 +1,16 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"@actions/core@1.2.2",
|
||||
"."
|
||||
]
|
||||
],
|
||||
"_from": "@actions/core@1.2.2",
|
||||
"_id": "@actions/core@1.2.2",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-IbCx7oefq+Gi6FWbSs2Fnw8VkEI6Y4gvjrYprY3RV//ksq/KPMlClOerJ4jRosyal6zkUIc8R9fS/cpRMlGClg==",
|
||||
"_location": "/@actions/core",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "@actions/core@1.2.2",
|
||||
"name": "@actions/core",
|
||||
"escapedName": "@actions%2fcore",
|
||||
"scope": "@actions",
|
||||
"rawSpec": "1.2.2",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "1.2.2"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.2.tgz",
|
||||
"_spec": "1.2.2",
|
||||
"_where": ".",
|
||||
"bugs": {
|
||||
"url": "https://github.com/actions/toolkit/issues"
|
||||
},
|
||||
"name": "@actions/core",
|
||||
"version": "1.2.3",
|
||||
"description": "Actions core lib",
|
||||
"devDependencies": {
|
||||
"@types/node": "^12.0.2"
|
||||
},
|
||||
"keywords": [
|
||||
"github",
|
||||
"actions",
|
||||
"core"
|
||||
],
|
||||
"homepage": "https://github.com/actions/toolkit/tree/master/packages/core",
|
||||
"license": "MIT",
|
||||
"main": "lib/core.js",
|
||||
"types": "lib/core.d.ts",
|
||||
"directories": {
|
||||
"lib": "lib",
|
||||
"test": "__tests__"
|
||||
@ -42,15 +18,6 @@
|
||||
"files": [
|
||||
"lib"
|
||||
],
|
||||
"homepage": "https://github.com/actions/toolkit/tree/master/packages/core",
|
||||
"keywords": [
|
||||
"github",
|
||||
"actions",
|
||||
"core"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "lib/core.js",
|
||||
"name": "@actions/core",
|
||||
"publishConfig": {
|
||||
"access": "public"
|
||||
},
|
||||
@ -64,6 +31,14 @@
|
||||
"test": "echo \"Error: run tests from root\" && exit 1",
|
||||
"tsc": "tsc"
|
||||
},
|
||||
"types": "lib/core.d.ts",
|
||||
"version": "1.2.2"
|
||||
}
|
||||
"bugs": {
|
||||
"url": "https://github.com/actions/toolkit/issues"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^12.0.2"
|
||||
}
|
||||
|
||||
,"_resolved": "https://registry.npmjs.org/@actions/core/-/core-1.2.3.tgz"
|
||||
,"_integrity": "sha512-Wp4xnyokakM45Uuj4WLUxdsa8fJjKVl1fDTsPbTEcTcuu0Nb26IPQbOtjmnfaCPGcaoPOOqId8H9NapZ8gii4w=="
|
||||
,"_from": "@actions/core@1.2.3"
|
||||
}
|
||||
15
node_modules/xmldom/.travis.yml
generated
vendored
15
node_modules/xmldom/.travis.yml
generated
vendored
@ -1,15 +0,0 @@
|
||||
language: node_js
|
||||
|
||||
cache:
|
||||
npm: false
|
||||
|
||||
node_js:
|
||||
- '0.10'
|
||||
|
||||
branches:
|
||||
only:
|
||||
- master
|
||||
- proof
|
||||
- travis-ci
|
||||
|
||||
script: npm test
|
||||
92
node_modules/xmldom/CHANGELOG.md
generated
vendored
Normal file
92
node_modules/xmldom/CHANGELOG.md
generated
vendored
Normal file
@ -0,0 +1,92 @@
|
||||
## 0.3.0
|
||||
|
||||
- Node >=10.x now required.
|
||||
- Added getElementsByClassName method.
|
||||
- Added Node to the list of exports
|
||||
- Added lowercase of åäö in entityMap.
|
||||
- Moved existing sources into `lib` subdirectory.
|
||||
- Removed `.npmignore` in favor of `files` entry in package.json.
|
||||
- More `package.json` refactoring.
|
||||
- Replaced CHANGELOG with more rigorous file.
|
||||
- Replaced LICENSE with more rigorous file.
|
||||
- Removed component.json (deprecated package manager https://github.com/componentjs/guide)
|
||||
- `proof` devDep updated to latest.
|
||||
- Fixed CI.
|
||||
- README updates.
|
||||
|
||||
## 0.2.1
|
||||
|
||||
- More package.json refactoring.
|
||||
|
||||
## 0.2.0
|
||||
|
||||
- Now publishing under xmldom npm package again; retiring xmldom-alpha.
|
||||
- Remove coveralls.
|
||||
- Disable cache in travis.
|
||||
- Other refactoring.
|
||||
|
||||
## 0.1.28 (via xmldom-alpha npm package)
|
||||
|
||||
- Removed __proto__ accessor.
|
||||
- Appended HTML entities defaults.
|
||||
|
||||
## 0.1.27 (via xmldom-alpha npm package)
|
||||
|
||||
- Various bug fixes.
|
||||
- Don't ask why 0.1.26 and 0.1.25 were skipped. `¯\_(ツ)_/¯`
|
||||
|
||||
## 0.1.24 (via xmldom-alpha package)
|
||||
|
||||
- Added node filter.
|
||||
|
||||
## 0.1.23 (via xmldom-alpha npm package)
|
||||
|
||||
- Added namespace support for nest node serialize.
|
||||
- Various other bug fixes.
|
||||
|
||||
## 0.1.22
|
||||
|
||||
- Merge XMLNS serialization.
|
||||
- Removed \r from source string.
|
||||
- Print namespaces for child elements.
|
||||
- Switch references to nodeType to use named constants.
|
||||
- Add nodelist toString support.
|
||||
|
||||
## 0.1.21
|
||||
|
||||
- Fixed serialize bug.
|
||||
|
||||
## 0.1.20
|
||||
|
||||
- Optimized invalid XML support.
|
||||
- Added toString sorter for attributes output.
|
||||
- Added html self closed node button.
|
||||
- Added `*` NS support for getElementsByTagNameNS.
|
||||
- Converted attribute's value to string in setAttributeNS.
|
||||
- Added support for HTML entities for HTML docs only.
|
||||
- Fixed TypeError when Document is created with DocumentType.
|
||||
|
||||
## 0.1.19
|
||||
|
||||
- Fixed issue #68, infinite loop on unclosed comment.
|
||||
- Added error report for unclosed tag.
|
||||
- Various other fixes.
|
||||
|
||||
## 0.1.18
|
||||
|
||||
- Added default `ns` support.
|
||||
- parseFromString now renders entirely plain text documents as textNode.
|
||||
- Enabled option to ignore white space on parsing.
|
||||
|
||||
## 0.1.16
|
||||
|
||||
- Correctly handle multibyte Unicode greater than two byts. #57. #56.
|
||||
- Initial unit testing and test coverage. #53. #46. #19.
|
||||
- Create Bower `component.json` #52.
|
||||
|
||||
## 0.1.8
|
||||
|
||||
- Add: some test case from node-o3-xml(excludes xpath support)
|
||||
- Fix: remove existed attribute before setting (bug introduced in v0.1.5)
|
||||
- Fix: index direct access for childNodes and any NodeList collection(not w3c standard)
|
||||
- Fix: remove last child bug
|
||||
8
node_modules/xmldom/LICENSE
generated
vendored
8
node_modules/xmldom/LICENSE
generated
vendored
@ -1,8 +0,0 @@
|
||||
You can choose any one of those:
|
||||
|
||||
The MIT License (MIT):
|
||||
|
||||
link:http://opensource.org/licenses/MIT
|
||||
|
||||
LGPL:
|
||||
http://www.gnu.org/licenses/lgpl.html
|
||||
4
node_modules/xmldom/LICENSE.md
generated
vendored
Normal file
4
node_modules/xmldom/LICENSE.md
generated
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
You can choose any one of these licenses:
|
||||
|
||||
- MIT: https://opensource.org/licenses/MIT
|
||||
- LGPL: http://www.gnu.org/licenses/lgpl.html
|
||||
4
node_modules/xmldom/__package__.js
generated
vendored
4
node_modules/xmldom/__package__.js
generated
vendored
@ -1,4 +0,0 @@
|
||||
this.addScript('dom.js',['DOMImplementation','XMLSerializer']);
|
||||
this.addScript('dom-parser.js',['DOMHandler','DOMParser'],
|
||||
['DOMImplementation','XMLReader']);
|
||||
this.addScript('sax.js','XMLReader');
|
||||
14
node_modules/xmldom/changelog
generated
vendored
14
node_modules/xmldom/changelog
generated
vendored
@ -1,14 +0,0 @@
|
||||
### Version 0.1.16
|
||||
|
||||
Sat May 4 14:58:03 UTC 2013
|
||||
|
||||
* Correctly handle multibyte Unicode greater than two byts. #57. #56.
|
||||
* Initial unit testing and test coverage. #53. #46. #19.
|
||||
* Create Bower `component.json` #52.
|
||||
|
||||
### Version 0.1.8
|
||||
|
||||
* Add: some test case from node-o3-xml(excludes xpath support)
|
||||
* Fix: remove existed attribute before setting (bug introduced in v0.1.5)
|
||||
* Fix: index direct access for childNodes and any NodeList collection(not w3c standard)
|
||||
* Fix: remove last child bug
|
||||
10
node_modules/xmldom/component.json
generated
vendored
10
node_modules/xmldom/component.json
generated
vendored
@ -1,10 +0,0 @@
|
||||
{
|
||||
"name": "xmldom",
|
||||
"version": "0.1.15",
|
||||
"main": "dom-parser.js",
|
||||
"ignore": [
|
||||
"**/.*",
|
||||
"node_modules",
|
||||
"components"
|
||||
]
|
||||
}
|
||||
15
node_modules/xmldom/dom-parser.js → node_modules/xmldom/lib/dom-parser.js
generated
vendored
15
node_modules/xmldom/dom-parser.js → node_modules/xmldom/lib/dom-parser.js
generated
vendored
@ -1,6 +1,5 @@
|
||||
function DOMParser(options){
|
||||
this.options = options ||{locator:{}};
|
||||
|
||||
}
|
||||
|
||||
DOMParser.prototype.parseFromString = function(source,mimeType){
|
||||
@ -15,7 +14,7 @@ DOMParser.prototype.parseFromString = function(source,mimeType){
|
||||
if(locator){
|
||||
domBuilder.setDocumentLocator(locator)
|
||||
}
|
||||
|
||||
|
||||
sax.errorHandler = buildErrorHandler(errorHandler,domBuilder,locator);
|
||||
sax.domBuilder = options.domBuilder || domBuilder;
|
||||
if(isHTML){
|
||||
@ -58,8 +57,8 @@ function buildErrorHandler(errorImpl,domBuilder,locator){
|
||||
/**
|
||||
* +ContentHandler+ErrorHandler
|
||||
* +LexicalHandler+EntityResolver2
|
||||
* -DeclHandler-DTDHandler
|
||||
*
|
||||
* -DeclHandler-DTDHandler
|
||||
*
|
||||
* DefaultHandler:EntityResolver, DTDHandler, ContentHandler, ErrorHandler
|
||||
* DefaultHandler2:DefaultHandler,LexicalHandler, DeclHandler, EntityResolver2
|
||||
* @link http://www.saxproject.org/apidoc/org/xml/sax/helpers/DefaultHandler.html
|
||||
@ -74,7 +73,7 @@ function position(locator,node){
|
||||
/**
|
||||
* @see org.xml.sax.ContentHandler#startDocument
|
||||
* @link http://www.saxproject.org/apidoc/org/xml/sax/ContentHandler.html
|
||||
*/
|
||||
*/
|
||||
DOMHandler.prototype = {
|
||||
startDocument : function() {
|
||||
this.doc = new DOMImplementation().createDocument(null, null, null);
|
||||
@ -88,7 +87,7 @@ DOMHandler.prototype = {
|
||||
var len = attrs.length;
|
||||
appendElement(this, el);
|
||||
this.currentElement = el;
|
||||
|
||||
|
||||
this.locator && position(this.locator,el)
|
||||
for (var i = 0 ; i < len; i++) {
|
||||
var namespaceURI = attrs.getURI(i);
|
||||
@ -151,7 +150,7 @@ DOMHandler.prototype = {
|
||||
this.locator && position(this.locator,comm)
|
||||
appendElement(this, comm);
|
||||
},
|
||||
|
||||
|
||||
startCDATA:function() {
|
||||
//used in characters() methods
|
||||
this.cdata = true;
|
||||
@ -159,7 +158,7 @@ DOMHandler.prototype = {
|
||||
endCDATA:function() {
|
||||
this.cdata = false;
|
||||
},
|
||||
|
||||
|
||||
startDTD:function(name, publicId, systemId) {
|
||||
var impl = this.doc.implementation;
|
||||
if (impl && impl.createDocumentType) {
|
||||
16
node_modules/xmldom/dom.js → node_modules/xmldom/lib/dom.js
generated
vendored
16
node_modules/xmldom/dom.js → node_modules/xmldom/lib/dom.js
generated
vendored
@ -608,6 +608,21 @@ Document.prototype = {
|
||||
return rtv;
|
||||
},
|
||||
|
||||
getElementsByClassName: function(className) {
|
||||
const pattern = new RegExp(`(^|\\s)${className}(\\s|$)`);
|
||||
return new LiveNodeList(this, base => {
|
||||
var ls = [];
|
||||
_visitNode(base.documentElement, node => {
|
||||
if(node !== base && node.nodeType == ELEMENT_NODE) {
|
||||
if(pattern.test(node.getAttribute('class'))) {
|
||||
ls.push(node);
|
||||
}
|
||||
}
|
||||
});
|
||||
return ls;
|
||||
});
|
||||
},
|
||||
|
||||
//document factory method:
|
||||
createElement : function(tagName){
|
||||
var node = new Element();
|
||||
@ -1235,6 +1250,7 @@ try{
|
||||
}
|
||||
|
||||
//if(typeof require == 'function'){
|
||||
exports.Node = Node;
|
||||
exports.DOMImplementation = DOMImplementation;
|
||||
exports.XMLSerializer = XMLSerializer;
|
||||
//}
|
||||
5
node_modules/xmldom/entities.js → node_modules/xmldom/lib/entities.js
generated
vendored
5
node_modules/xmldom/entities.js → node_modules/xmldom/lib/entities.js
generated
vendored
@ -9,7 +9,9 @@ exports.entityMap = {
|
||||
Acirc: "Â",
|
||||
Atilde: "Ã",
|
||||
Auml: "Ä",
|
||||
auml: "ä",
|
||||
Aring: "Å",
|
||||
aring: "å",
|
||||
AElig: "Æ",
|
||||
Ccedil: "Ç",
|
||||
Egrave: "È",
|
||||
@ -27,6 +29,7 @@ exports.entityMap = {
|
||||
Ocirc: "Ô",
|
||||
Otilde: "Õ",
|
||||
Ouml: "Ö",
|
||||
ouml: "ö",
|
||||
Oslash: "Ø",
|
||||
Ugrave: "Ù",
|
||||
Uacute: "Ú",
|
||||
@ -241,4 +244,4 @@ exports.entityMap = {
|
||||
hearts: "♥",
|
||||
diams: "♦"
|
||||
};
|
||||
//for(var n in exports.entityMap){console.log(exports.entityMap[n].charCodeAt())}
|
||||
//for(var n in exports.entityMap){console.log(exports.entityMap[n].charCodeAt())}
|
||||
0
node_modules/xmldom/sax.js → node_modules/xmldom/lib/sax.js
generated
vendored
0
node_modules/xmldom/sax.js → node_modules/xmldom/lib/sax.js
generated
vendored
134
node_modules/xmldom/package.json
generated
vendored
134
node_modules/xmldom/package.json
generated
vendored
@ -1,67 +1,7 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"xmldom@0.2.1",
|
||||
"."
|
||||
]
|
||||
],
|
||||
"_from": "xmldom@0.2.1",
|
||||
"_id": "xmldom@0.2.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-kXXiYvmblIgEemGeB75y97FyaZavx6SQhGppLw5TKWAD2Wd0KAly0g23eVLh17YcpxZpnFym1Qk/eaRjy1APPg==",
|
||||
"_location": "/xmldom",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "xmldom@0.2.1",
|
||||
"name": "xmldom",
|
||||
"escapedName": "xmldom",
|
||||
"rawSpec": "0.2.1",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "0.2.1"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.2.1.tgz",
|
||||
"_spec": "0.2.1",
|
||||
"_where": ".",
|
||||
"author": {
|
||||
"name": "jindw",
|
||||
"email": "jindw@xidea.org",
|
||||
"url": "http://www.xidea.org"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "http://github.com/xmldom/xmldom/issues",
|
||||
"email": "jindw@xidea.org"
|
||||
},
|
||||
"contributors": [
|
||||
{
|
||||
"name": "Yaron Naveh",
|
||||
"email": "yaronn01@gmail.com",
|
||||
"url": "http://webservices20.blogspot.com/"
|
||||
},
|
||||
{
|
||||
"name": "Harutyun Amirjanyan",
|
||||
"email": "amirjanyan@gmail.com",
|
||||
"url": "https://github.com/nightwing"
|
||||
},
|
||||
{
|
||||
"name": "Alan Gutierrez",
|
||||
"email": "alan@prettyrobots.com",
|
||||
"url": "http://www.prettyrobots.com/"
|
||||
}
|
||||
],
|
||||
"dependencies": {},
|
||||
"description": "A W3C Standard XML DOM(Level2 CORE) implementation and parser(DOMParser/XMLSerializer).",
|
||||
"devDependencies": {
|
||||
"proof": "0.0.28"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.1"
|
||||
},
|
||||
"homepage": "https://github.com/xmldom/xmldom",
|
||||
"name": "xmldom",
|
||||
"version": "0.3.0",
|
||||
"description": "A pure JavaScript W3C standard-based (XML DOM Level 2 Core) DOMParser and XMLSerializer module.",
|
||||
"keywords": [
|
||||
"w3c",
|
||||
"dom",
|
||||
@ -71,22 +11,66 @@
|
||||
"DOMParser",
|
||||
"XMLSerializer"
|
||||
],
|
||||
"license": "(LGPL-2.0 or MIT)",
|
||||
"main": "./dom-parser.js",
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "jindw",
|
||||
"email": "jindw@xidea.org",
|
||||
"url": "http://www.xidea.org"
|
||||
}
|
||||
],
|
||||
"name": "xmldom",
|
||||
"author": "jindw <jindw@xidea.org> (http://www.xidea.org)",
|
||||
"homepage": "https://github.com/xmldom/xmldom",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git://github.com/xmldom/xmldom.git"
|
||||
},
|
||||
"main": "lib/dom-parser.js",
|
||||
"files": [
|
||||
"lib"
|
||||
],
|
||||
"scripts": {
|
||||
"test": "proof platform win32 && proof test */*/*.t.js || t/test"
|
||||
},
|
||||
"version": "0.2.1"
|
||||
}
|
||||
"engines": {
|
||||
"node": ">=10.0.0"
|
||||
},
|
||||
"dependencies": {},
|
||||
"devDependencies": {
|
||||
"proof": "~7.0.9"
|
||||
},
|
||||
"maintainers": [
|
||||
{
|
||||
"name": "brodybits",
|
||||
"email": "chris@brody.consulting",
|
||||
"url": "https://github.com/brodybits"
|
||||
}
|
||||
],
|
||||
"contributors": [
|
||||
{
|
||||
"name": "jindw",
|
||||
"email": "jindw@xidea.org",
|
||||
"url": "http://www.xidea.org"
|
||||
},
|
||||
{
|
||||
"name": "Yaron Naveh",
|
||||
"email": "yaronn01@gmail.com",
|
||||
"web": "http://webservices20.blogspot.com/"
|
||||
},
|
||||
{
|
||||
"name": "Harutyun Amirjanyan",
|
||||
"email": "amirjanyan@gmail.com",
|
||||
"web": "https://github.com/nightwing"
|
||||
},
|
||||
{
|
||||
"name": "Alan Gutierrez",
|
||||
"email": "alan@prettyrobots.com",
|
||||
"web": "http://www.prettyrobots.com/"
|
||||
},
|
||||
{
|
||||
"name": "Eric Newport",
|
||||
"email": "kethinov@gmail.com",
|
||||
"web": "https://github.com/kethinov"
|
||||
}
|
||||
],
|
||||
"bugs": {
|
||||
"url": "https://github.com/xmldom/xmldom/issues"
|
||||
},
|
||||
"license": "(LGPL-2.0 OR MIT)"
|
||||
|
||||
,"_resolved": "https://registry.npmjs.org/xmldom/-/xmldom-0.3.0.tgz"
|
||||
,"_integrity": "sha512-z9s6k3wxE+aZHgXYxSTpGDo7BYOUfJsIRyoZiX6HTjwpwfS2wpQBQKa2fD+ShLyPkqDYo5ud7KitmLZ2Cd6r0g=="
|
||||
,"_from": "xmldom@0.3.0"
|
||||
}
|
||||
4
node_modules/xmldom/readme.md
generated
vendored
4
node_modules/xmldom/readme.md
generated
vendored
@ -1,9 +1,11 @@
|
||||
# XMLDOM [](http://travis-ci.org/bigeasy/xmldom) [](https://coveralls.io/r/bigeasy/xmldom) [](http://badge.fury.io/js/xmldom)
|
||||
# XMLDOM [](http://travis-ci.org/xmldom/xmldom) [](http://badge.fury.io/js/xmldom)
|
||||
|
||||
A JavaScript implementation of W3C DOM for Node.js, Rhino and the browser. Fully
|
||||
compatible with `W3C DOM level2`; and some compatible with `level3`. Supports
|
||||
`DOMParser` and `XMLSerializer` interface such as in browser.
|
||||
|
||||
**Original project location:** <https://github.com/jindw/xmldom>
|
||||
|
||||
Install:
|
||||
-------
|
||||
>npm install xmldom
|
||||
|
||||
66
node_modules/xpath/package.json
generated
vendored
66
node_modules/xpath/package.json
generated
vendored
@ -1,38 +1,13 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"xpath@0.0.27",
|
||||
"."
|
||||
]
|
||||
],
|
||||
"_from": "xpath@0.0.27",
|
||||
"_id": "xpath@0.0.27",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-fg03WRxtkCV6ohClePNAECYsmpKKTv5L8y/X3Dn1hQrec3POx2jHZ/0P2qQ6HvsrU1BmeqXcof3NGGueG6LxwQ==",
|
||||
"_location": "/xpath",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "xpath@0.0.27",
|
||||
"name": "xpath",
|
||||
"escapedName": "xpath",
|
||||
"rawSpec": "0.0.27",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "0.0.27"
|
||||
"name": "xpath",
|
||||
"version": "0.0.27",
|
||||
"description": "DOM 3 XPath implemention and helper for node.js.",
|
||||
"engines": {
|
||||
"node": ">=0.6.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/xpath/-/xpath-0.0.27.tgz",
|
||||
"_spec": "0.0.27",
|
||||
"_where": ".",
|
||||
"author": {
|
||||
"name": "Cameron McCormack"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/goto100/xpath/issues"
|
||||
},
|
||||
"contributors": [
|
||||
{
|
||||
"name": "goto100"
|
||||
@ -42,29 +17,26 @@
|
||||
}
|
||||
],
|
||||
"dependencies": {},
|
||||
"description": "DOM 3 XPath implemention and helper for node.js.",
|
||||
"devDependencies": {
|
||||
"nodeunit": ">=0.6.4",
|
||||
"xmldom": "^0.1.19"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=0.6.0"
|
||||
"typings": "./xpath.d.ts",
|
||||
"scripts": {
|
||||
"test": "./node_modules/.bin/nodeunit test.js"
|
||||
},
|
||||
"homepage": "https://github.com/goto100/xpath#readme",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "https://github.com/goto100/xpath.git"
|
||||
},
|
||||
"main": "./xpath.js",
|
||||
"keywords": [
|
||||
"xpath",
|
||||
"xml"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "./xpath.js",
|
||||
"name": "xpath",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/goto100/xpath.git"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "nodeunit test.js"
|
||||
},
|
||||
"typings": "./xpath.d.ts",
|
||||
"version": "0.0.27"
|
||||
}
|
||||
"license": "MIT"
|
||||
|
||||
,"_resolved": "https://registry.npmjs.org/xpath/-/xpath-0.0.27.tgz"
|
||||
,"_integrity": "sha512-fg03WRxtkCV6ohClePNAECYsmpKKTv5L8y/X3Dn1hQrec3POx2jHZ/0P2qQ6HvsrU1BmeqXcof3NGGueG6LxwQ=="
|
||||
,"_from": "xpath@0.0.27"
|
||||
}
|
||||
1830
package-lock.json
generated
1830
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
@ -24,12 +24,12 @@
|
||||
},
|
||||
"homepage": "https://github.com/s4u/maven-settings-action#readme",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.2.2",
|
||||
"xmldom": "^0.2.1",
|
||||
"@actions/core": "^1.2.3",
|
||||
"xmldom": "^0.3.0",
|
||||
"xpath": "0.0.27"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint": "^6.8.0",
|
||||
"jest": "^25.1.0"
|
||||
"jest": "^25.2.7"
|
||||
}
|
||||
}
|
||||
|
||||
96
settings.js
96
settings.js
@ -52,6 +52,34 @@ function writeSettings(settingsPath, templateXml) {
|
||||
fs.writeFileSync(settingsPath, settingStr);
|
||||
}
|
||||
|
||||
function createElementWithText(template, tag, text) {
|
||||
const tagXml = template.createElement(tag);
|
||||
tagXml.textContent = text;
|
||||
return tagXml;
|
||||
}
|
||||
|
||||
function fillServer(template, id, username, password) {
|
||||
|
||||
const serverXml = template.createElement('server');
|
||||
|
||||
if (!id || !username || !password) {
|
||||
core.setFailed('servers must contain id, username and password');
|
||||
return;
|
||||
}
|
||||
|
||||
const idXml = createElementWithText(template, 'id', id);
|
||||
serverXml.appendChild(idXml);
|
||||
|
||||
const usernameXml = createElementWithText(template, 'username', username);
|
||||
serverXml.appendChild(usernameXml);
|
||||
|
||||
const passwordXml = createElementWithText(template, 'password', password);
|
||||
serverXml.appendChild(passwordXml);
|
||||
|
||||
const serversXml = template.getElementsByTagName('servers')[0];
|
||||
serversXml.appendChild(serverXml);
|
||||
}
|
||||
|
||||
function fillServers(template) {
|
||||
|
||||
const servers = core.getInput('servers');
|
||||
@ -60,19 +88,57 @@ function fillServers(template) {
|
||||
return;
|
||||
}
|
||||
|
||||
const serversXml = template.getElementsByTagName('servers')[0];
|
||||
JSON.parse(servers).forEach((server) => fillServer(template, server.id, server.username, server.password));
|
||||
}
|
||||
|
||||
JSON.parse(servers).forEach((server) => {
|
||||
function fillMirror(template, id, name, mirrorOf, url) {
|
||||
|
||||
const serverXml = template.createElement('server');
|
||||
serversXml.appendChild(serverXml);
|
||||
const mirrorXml = template.createElement('mirror');
|
||||
|
||||
for (const key in server) {
|
||||
const keyXml = template.createElement(key);
|
||||
keyXml.textContent = server[key];
|
||||
serverXml.appendChild(keyXml);
|
||||
}
|
||||
});
|
||||
if (!id || !name || !mirrorOf || !url) {
|
||||
core.setFailed('mirrors must contain id, name, mirrorOf and url');
|
||||
return;
|
||||
}
|
||||
|
||||
const idXml = createElementWithText(template, 'id', id);
|
||||
mirrorXml.appendChild(idXml);
|
||||
|
||||
const nameXml = createElementWithText(template, 'name', name);
|
||||
mirrorXml.appendChild(nameXml);
|
||||
|
||||
const mirrorOfXml = createElementWithText(template, 'mirrorOf', mirrorOf);
|
||||
mirrorXml.appendChild(mirrorOfXml);
|
||||
|
||||
const urlXml = createElementWithText(template, 'url', url);
|
||||
mirrorXml.appendChild(urlXml);
|
||||
|
||||
const mirrorsXml = template.getElementsByTagName('mirrors')[0];
|
||||
mirrorsXml.appendChild(mirrorXml);
|
||||
}
|
||||
|
||||
function fillMirrors(template) {
|
||||
|
||||
const mirrors = core.getInput('mirrors');
|
||||
|
||||
if (!mirrors) {
|
||||
return;
|
||||
}
|
||||
|
||||
JSON.parse(mirrors).forEach((mirror) => fillMirror(template, mirror.id, mirror.name, mirror.mirrorOf, mirror.url));
|
||||
}
|
||||
|
||||
function isInputTrue(inputName) {
|
||||
const val = core.getInput(inputName);
|
||||
return val && val.toLocaleLowerCase() == 'true';
|
||||
}
|
||||
|
||||
function fillServerForGithub(templateXml) {
|
||||
|
||||
if (!isInputTrue('githubServer')) {
|
||||
return;
|
||||
}
|
||||
|
||||
fillServer(templateXml, 'github', '${env.GITHUB_ACTOR}', '${env.GITHUB_TOKEN}');
|
||||
}
|
||||
|
||||
function activateProfile(template, profileId) {
|
||||
@ -106,8 +172,7 @@ function fillProperties(template) {
|
||||
}
|
||||
|
||||
function addSonatypeSnapshots(template) {
|
||||
const val = core.getInput('sonatypeSnapshots');
|
||||
if (val && val.toLocaleLowerCase() == 'true') {
|
||||
if (isInputTrue('sonatypeSnapshots')) {
|
||||
activateProfile(template, '_sonatype-snapshots_')
|
||||
}
|
||||
}
|
||||
@ -119,8 +184,7 @@ function generate() {
|
||||
core.info('Prepare maven setings: ' + settingsPath);
|
||||
|
||||
if (fs.existsSync(settingsPath)) {
|
||||
const val = core.getInput("override");
|
||||
if (val && val.toLocaleLowerCase() == 'true') {
|
||||
if (isInputTrue('override')) {
|
||||
core.info('maven settings.xml already exists - override');
|
||||
} else {
|
||||
core.warning('maven settings.xml already exists - skip');
|
||||
@ -129,7 +193,9 @@ function generate() {
|
||||
}
|
||||
|
||||
const templateXml = getSettingsTemplate();
|
||||
fillMirrors(templateXml);
|
||||
fillServers(templateXml);
|
||||
fillServerForGithub(templateXml);
|
||||
fillProperties(templateXml);
|
||||
addSonatypeSnapshots(templateXml);
|
||||
writeSettings(settingsPath, templateXml);
|
||||
@ -155,7 +221,9 @@ function cleanup() {
|
||||
module.exports = {
|
||||
getSettingsTemplate,
|
||||
writeSettings,
|
||||
fillMirrors,
|
||||
fillServers,
|
||||
fillServerForGithub,
|
||||
fillProperties,
|
||||
addSonatypeSnapshots,
|
||||
generate,
|
||||
|
||||
@ -87,7 +87,7 @@ afterAll(() => {
|
||||
afterEach(() => {
|
||||
|
||||
for (key in process.env) {
|
||||
if (key.match(/^INPUT_/)) {
|
||||
if (key.match(/^INPUT_/) || key.match(/^GITHUB_/)) {
|
||||
delete process.env[key];
|
||||
}
|
||||
}
|
||||
@ -99,7 +99,6 @@ afterEach(() => {
|
||||
});
|
||||
|
||||
test('template should be read', () => {
|
||||
|
||||
const template = settings.getSettingsTemplate();
|
||||
|
||||
expect(template).toBeDefined();
|
||||
@ -133,7 +132,6 @@ test('fillServers one server', () => {
|
||||
|
||||
const xml = new DOMParser().parseFromString("<servers/>");
|
||||
|
||||
|
||||
process.env['INPUT_SERVERS'] = '[{"id": "id1", "username": "username1", "password":"password1"}]';
|
||||
|
||||
settings.fillServers(xml);
|
||||
@ -162,6 +160,97 @@ test('fillServers two servers', () => {
|
||||
"</servers>");
|
||||
});
|
||||
|
||||
test('fillServers incorrect fields', () => {
|
||||
|
||||
const xml = new DOMParser().parseFromString("<servers/>");
|
||||
|
||||
process.env['INPUT_SERVERS'] = '[{"idx": "id1"}]';
|
||||
|
||||
settings.fillServers(xml);
|
||||
|
||||
const xmlStr = new XMLSerializer().serializeToString(xml);
|
||||
|
||||
expect(xmlStr).toBe('<servers/>');
|
||||
expect(consoleOutput).toEqual(
|
||||
expect.arrayContaining([
|
||||
expect.stringMatching(/::error::servers must contain id, username and password/)
|
||||
])
|
||||
);
|
||||
});
|
||||
|
||||
test('fillServers github', () => {
|
||||
|
||||
const xml = new DOMParser().parseFromString("<servers/>");
|
||||
|
||||
process.env['INPUT_GITHUBSERVER'] = 'true';
|
||||
|
||||
settings.fillServerForGithub(xml);
|
||||
|
||||
const xmlStr = new XMLSerializer().serializeToString(xml);
|
||||
|
||||
expect(xmlStr).toBe('<servers><server><id>github</id><username>${env.GITHUB_ACTOR}</username><password>${env.GITHUB_TOKEN}</password></server></servers>');
|
||||
expect(consoleOutput).toEqual([]);
|
||||
});
|
||||
|
||||
test('fillMirrors do nothing if no params', () => {
|
||||
|
||||
const xml = new DOMParser().parseFromString("<mirrors/>");
|
||||
|
||||
settings.fillMirrors(xml);
|
||||
|
||||
const xmlStr = new XMLSerializer().serializeToString(xml);
|
||||
|
||||
expect(xmlStr).toBe("<mirrors/>");
|
||||
});
|
||||
|
||||
test('fillMirrors one mirror', () => {
|
||||
|
||||
const xml = new DOMParser().parseFromString("<mirrors/>");
|
||||
|
||||
process.env['INPUT_MIRRORS'] = '[{"id": "id1", "name": "name", "mirrorOf":"mirrorOf", "url":"url"}]';
|
||||
|
||||
settings.fillMirrors(xml);
|
||||
|
||||
const xmlStr = new XMLSerializer().serializeToString(xml);
|
||||
|
||||
expect(xmlStr).toBe("<mirrors>" +
|
||||
"<mirror><id>id1</id><name>name</name><mirrorOf>mirrorOf</mirrorOf><url>url</url></mirror>" +
|
||||
"</mirrors>");
|
||||
});
|
||||
|
||||
test('fillMirrors two mirrors', () => {
|
||||
|
||||
const xml = new DOMParser().parseFromString("<mirrors/>");
|
||||
|
||||
process.env['INPUT_MIRRORS'] = '[{"id": "id1", "name": "name1", "mirrorOf":"mirrorOf1", "url":"url1"},{"id": "id2", "name": "name2", "mirrorOf":"mirrorOf2", "url":"url2"}]';
|
||||
|
||||
settings.fillMirrors(xml);
|
||||
|
||||
const xmlStr = new XMLSerializer().serializeToString(xml);
|
||||
|
||||
expect(xmlStr).toBe("<mirrors>" +
|
||||
"<mirror><id>id1</id><name>name1</name><mirrorOf>mirrorOf1</mirrorOf><url>url1</url></mirror><mirror><id>id2</id><name>name2</name><mirrorOf>mirrorOf2</mirrorOf><url>url2</url></mirror>" +
|
||||
"</mirrors>");
|
||||
});
|
||||
|
||||
test('fillMirrors incorrect fields', () => {
|
||||
|
||||
const xml = new DOMParser().parseFromString("<mirrors/>");
|
||||
|
||||
process.env['INPUT_MIRRORS'] = '[{"idx": "id1"}]';
|
||||
|
||||
settings.fillMirrors(xml);
|
||||
|
||||
const xmlStr = new XMLSerializer().serializeToString(xml);
|
||||
|
||||
expect(xmlStr).toBe('<mirrors/>');
|
||||
expect(consoleOutput).toEqual(
|
||||
expect.arrayContaining([
|
||||
expect.stringMatching(/::error::mirrors must contain id, name, mirrorOf and url/)
|
||||
])
|
||||
);
|
||||
});
|
||||
|
||||
test('addSonatypeSnapshots activate', () => {
|
||||
|
||||
process.env['INPUT_SONATYPESNAPSHOTS'] = "true";
|
||||
@ -279,7 +368,7 @@ test('cleanup - ok', () => {
|
||||
|
||||
test('genereate', () => {
|
||||
|
||||
process.env['INPUT_SERVERS'] = '[{"id": "serverId", "username": "username", "password": "password"}]';
|
||||
process.env['INPUT_SERVERS'] = '[{"id": "serverId", "username": "username", "password": "password"}]';
|
||||
process.env['INPUT_PROPERTIES'] = '[{"prop1": "value1"}, {"prop2": "value2"}]'
|
||||
process.env['INPUT_SONATYPESNAPSHOT'] = true;
|
||||
|
||||
|
||||
@ -1,48 +1,46 @@
|
||||
<settings>
|
||||
|
||||
<interactiveMode>false</interactiveMode>
|
||||
|
||||
<profiles>
|
||||
<profile>
|
||||
<id>_properties_</id>
|
||||
<activation>
|
||||
<activeByDefault>false</activeByDefault>
|
||||
</activation>
|
||||
<properties />
|
||||
</profile>
|
||||
|
||||
<profile>
|
||||
<id>_sonatype-snapshots_</id>
|
||||
<activation>
|
||||
<activeByDefault>false</activeByDefault>
|
||||
</activation>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>sonatype-snapshots</id>
|
||||
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
|
||||
<releases>
|
||||
<enabled>false</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
</repositories>
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>sonatype-snapshots</id>
|
||||
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
|
||||
<releases>
|
||||
<enabled>false</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
</profile>
|
||||
|
||||
</profiles>
|
||||
|
||||
<servers />
|
||||
<interactiveMode>false</interactiveMode>
|
||||
<profiles>
|
||||
<!-- generic ############################################################# -->
|
||||
<profile>
|
||||
<id>_properties_</id>
|
||||
<activation>
|
||||
<activeByDefault>false</activeByDefault>
|
||||
</activation>
|
||||
<properties />
|
||||
</profile>
|
||||
<!-- sonatype ############################################################# -->
|
||||
<profile>
|
||||
<id>_sonatype-snapshots_</id>
|
||||
<activation>
|
||||
<activeByDefault>false</activeByDefault>
|
||||
</activation>
|
||||
<repositories>
|
||||
<repository>
|
||||
<id>sonatype-snapshots</id>
|
||||
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
|
||||
<releases>
|
||||
<enabled>false</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
</repository>
|
||||
</repositories>
|
||||
<pluginRepositories>
|
||||
<pluginRepository>
|
||||
<id>sonatype-snapshots</id>
|
||||
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
|
||||
<releases>
|
||||
<enabled>false</enabled>
|
||||
</releases>
|
||||
<snapshots>
|
||||
<enabled>true</enabled>
|
||||
</snapshots>
|
||||
</pluginRepository>
|
||||
</pluginRepositories>
|
||||
</profile>
|
||||
</profiles>
|
||||
<servers />
|
||||
<mirrors />
|
||||
</settings>
|
||||
|
||||
Reference in New Issue
Block a user