Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for default-for attribute #275

Merged
merged 1 commit into from
May 3, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 17 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,6 @@ It should contain the following entries:
```json
[
{
"latest": false,
"metadata-version": "0.0.1",
"module": "org.example:library",
"tested-versions": [
Expand All @@ -106,8 +105,23 @@ The `override` flag allows to express the intent to exclude outdated builtin met
So, the metadata for `org.example:library:0.0.1` and `org.example:library:0.0.2` is located
at `metadata/org.example/library/0.0.1`.

Make sure that each supported version is listed in `tested-versions`, as that value is used in build tools to match
metadata to a specific library.
For entries without `"latest": true`, it is recommended to define the optional `default-for` key with a value containing
a regexp (Java format) matching the version pattern. For example, for the example above, the first entry could be:

```json
{
"metadata-version": "0.0.1",
"module": "org.example:library",
"tested-versions": [
"0.0.1",
"0.0.2"
],
"default-for": "0\\.0\\..*"
}
```

You can also list each supported version is listed in `tested-versions`, as that value is used in build tools to match
metadata to a specific library, but this is more likely to break when new versions are released.
Every metadata for a specific library version has a `index.json`. For this
example `metadata/org.example/library/0.0.1/index.json` would contain:

Expand Down
1 change: 1 addition & 0 deletions metadata/org.hibernate.orm/hibernate-core/index.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
},
{
"metadata-version": "6.1.1.Final",
"default-for": "6\\.1\\..*",
"module": "org.hibernate.orm:hibernate-core",
"tested-versions": [
"6.1.1.Final"
Expand Down