Skip to content

Commit 1b5e4ef

Browse files
authored
Merge pull request #760 from bci-oss/700-allow-referencing-aspect-models-from-multiple-repositories
700 allow referencing aspect models from multiple repositories
2 parents f4e6ccc + 2c46610 commit 1b5e4ef

File tree

8 files changed

+105
-64
lines changed

8 files changed

+105
-64
lines changed

documentation/developer-guide/modules/tooling-guide/pages/maven-plugin.adoc

Lines changed: 25 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,14 +25,17 @@ The current implementation of the `esmf-aspect-model-maven-plugin` uses the
2525
`FileSystemStrategy` or the `GitHubStrategy`, or combination of both, to resolve Aspect Models. See
2626
xref:java-aspect-tooling.adoc#understanding-model-resolution[Understanding Model Resolution] for
2727
more information. Generally, the configuration for every Maven goal described here must be
28-
configured using either the `modelsRootDirectory` or the `githubServerId` attribute, or both.
28+
configured using either the `modelsRootDirectory` or the `githubServerIds` attribute, or both.
2929

3030
The `modelsRootDirectory` points to a (relative or absolute) local file system directory path.
3131

32-
The `githubServerId` points to the `<id>` of a `<server>` configuration in the Maven settings. For
33-
example, if the configuration for the esmf-aspect-model-maven-plugin contains
34-
`<githubServerId>my-gh-repo</githubServerId>`, your https://maven.apache.org/settings.html[Maven
35-
Settings] should contain a corresonding `<server>` entry:
32+
The `githubServerIds` point to the `<id>` entries of `<server>` configurations in the Maven settings.
33+
For example, if the configuration for the esmf-aspect-model-maven-plugin contains
34+
multiple `<githubServerId>` entries such as `<githubServerId>my-gh-repo-1</githubServerId>`
35+
and `<githubServerId>my-gh-repo-2</githubServerId>`,
36+
your https://maven.apache.org/settings.html[Maven Settings] should contain corresponding
37+
`<server>` entries for each ID:
38+
3639

3740
[source,xml,subs=attributes+]
3841
----
@@ -82,7 +85,9 @@ Usage:
8285
</executions>
8386
<configuration>
8487
<modelsRootDirectory>$\{path-to-models-root}</modelsRootDirectory>
85-
<githubServerId>my-github-repo</githubServerId>
88+
<githubServerIds>
89+
<githubServerId>test-github-config</githubServerId>
90+
</githubServerIds>
8691
<includes>
8792
<include>$\{urn-of-aspect-model-to-be-included}</include>
8893
</includes>
@@ -99,6 +104,7 @@ Configuration Properties:
99104
| Property | Description | Type | Default Value | Required
100105
| `detailedValidationMessages` | Print detailed validation messages | `Boolean` | `false` | {nok}
101106
| `modelsRootDirectory` | The path to the root directory containing the Aspect Model file(s). | `String` | `$\{basedir}/src/main/resources/aspects` | {nok}
107+
| `githubServerIds` | A list of `githubServerId` values, each referring to a `<server>` entry in the Maven `settings.xml`, defining the GitHub repositories to resolve models from. | `List<String>` | none | {nok}
102108
| `githubServerId` | The id of the `<server>` entry describing the GitHub repository to resolve models from. | `String` | none | {nok}
103109
| `includes` | A list of Aspect Model URNs identifying the Aspect Models to be included in the plugin execution. | `String` | none | {ok}
104110
|===
@@ -146,6 +152,7 @@ Configuration Properties:
146152
| Property | Description | Type | Default Value | Required
147153
| `detailedValidationMessages` | Detailed validation messages if the model can not be loaded | `Boolean` | `false` | {nok}
148154
| `modelsRootDirectory` | The path to the root directory containing the Aspect Model file(s). | `String` | `$\{basedir}/src/main/resources/aspects` | {nok}
155+
| `githubServerIds` | A list of `githubServerId` values, each referring to a `<server>` entry in the Maven `settings.xml`, defining the GitHub repositories to resolve models from. | `List<String>` | none | {nok}
149156
| `githubServerId` | The id of the `<server>` entry describing the GitHub repository to resolve models from. | `String` | none | {nok}
150157
| `includes` | A list of Aspect Model URNs identifying the Aspect Models to be included in the plugin execution. | `String` | none | {ok}
151158
| `outputDirectory` | The path to the directory where the generated Java files will be written to. | `String` | none | {ok}
@@ -207,6 +214,7 @@ Configuration Properties:
207214
| Property | Description | Type | Default Value | Required
208215
| `detailedValidationMessages` | Detailed validation messages if the model can not be loaded | `Boolean` | `false` | {nok}
209216
| `modelsRootDirectory` | The path to the root directory containing the Aspect Model file(s). | `String` | `$\{basedir}/src/main/resources/aspects` | {nok}
217+
| `githubServerIds` | A list of `githubServerId` values, each referring to a `<server>` entry in the Maven `settings.xml`, defining the GitHub repositories to resolve models from. | `List<String>` | none | {nok}
210218
| `githubServerId` | The id of the `<server>` entry describing the GitHub repository to resolve models from. | `String` | none | {nok}
211219
| `includes` | A list of Aspect Model URNs identifying the Aspect Models to be included in the plugin execution. | `String` | none | {ok}
212220
| `outputDirectory` | The path to the directory where the generated Java files will be written to. | `String` | none | {ok}
@@ -261,6 +269,7 @@ Configuration Properties:
261269
| Property | Description | Type | Default Value | Required
262270
| `detailedValidationMessages` | Detailed validation messages if the model can not be loaded | `Boolean` | `false` | {nok}
263271
| `modelsRootDirectory` | The path to the root directory containing the Aspect Model file(s). | `String` | `$\{basedir}/src/main/resources/aspects` | {nok}
272+
| `githubServerIds` | A list of `githubServerId` values, each referring to a `<server>` entry in the Maven `settings.xml`, defining the GitHub repositories to resolve models from. | `List<String>` | none | {nok}
264273
| `githubServerId` | The id of the `<server>` entry describing the GitHub repository to resolve models from. | `String` | none | {nok}
265274
| `includes` | A list of Aspect Model URNs identifying the Aspect Models to be included in the plugin execution. | `String` | none | {ok}
266275
| `outputDirectory` | The path to the directory where the generated JSON Schema will be written to. | `String` | none | {ok}
@@ -310,6 +319,7 @@ Configuration Properties:
310319
| Property | Description | Type | Default Value | Required
311320
| `detailedValidationMessages` | Detailed validation messages if the model can not be loaded | `Boolean` | `false` | {nok}
312321
| `modelsRootDirectory` | The path to the root directory containing the Aspect Model file(s). | `String` | `$\{basedir}/src/main/resources/aspects` | {nok}
322+
| `githubServerIds` | A list of `githubServerId` values, each referring to a `<server>` entry in the Maven `settings.xml`, defining the GitHub repositories to resolve models from. | `List<String>` | none | {nok}
313323
| `githubServerId` | The id of the `<server>` entry describing the GitHub repository to resolve models from. | `String` | none | {nok}
314324
| `includes` | A list of Aspect Model URNs identifying the Aspect Models to be included in the plugin execution. | `String` | none | {ok}
315325
| `outputDirectory` | The path to the directory where the generated OpenAPI Specification will be written to. | `String` | none | {ok}
@@ -372,6 +382,7 @@ Configuration Properties:
372382
|===
373383
| Property | Description | Type | Default Value | Required
374384
| `modelsRootDirectory` | The path to the root directory containing the Aspect Model file(s). | `String` | `$\{basedir}/src/main/resources/aspects` | {nok}
385+
| `githubServerIds` | A list of `githubServerId` values, each referring to a `<server>` entry in the Maven `settings.xml`, defining the GitHub repositories to resolve models from. | `List<String>` | none | {nok}
375386
| `githubServerId` | The id of the `<server>` entry describing the GitHub repository to resolve models from. | `String` | none | {nok}
376387
| `outputDirectory` | The path to the directory where the generated AsyncAPI Specification will be written to. | `String` | none | {ok}
377388
| `applicationId` | Sets the application id, e.g. an identifying URL | `String` | none | {nok}
@@ -474,6 +485,7 @@ Configuration Properties:
474485
| Property | Description | Type | Default Value | Required
475486
| `detailedValidationMessages` | Detailed validation messages if the model can not be loaded | `Boolean` | `false` | {nok}
476487
| `modelsRootDirectory` | The path to the root directory containing the Aspect Model file(s). | `String` | `$\{basedir}/src/main/resources/aspects` | {nok}
488+
| `githubServerIds` | A list of `githubServerId` values, each referring to a `<server>` entry in the Maven `settings.xml`, defining the GitHub repositories to resolve models from. | `List<String>` | none | {nok}
477489
| `githubServerId` | The id of the `<server>` entry describing the GitHub repository to resolve models from. | `String` | none | {nok}
478490
| `includes` | A list of Aspect Model URNs identifying the Aspect Models to be included in the plugin execution. | `String` | none | {ok}
479491
| `outputDirectory` | The path to the directory where the generated OpenAPI Specification will be written to. | `String` | none | {ok}
@@ -537,6 +549,7 @@ Configuration Properties:
537549
|===
538550
| Property | Description | Type | Default Value | Required
539551
| `modelsRootDirectory` | The path to the root directory containing the Aspect Model file(s). | `String` | `$\{basedir}/src/main/resources/aspects` | {nok}
552+
| `githubServerIds` | A list of `githubServerId` values, each referring to a `<server>` entry in the Maven `settings.xml`, defining the GitHub repositories to resolve models from. | `List<String>` | none | {nok}
540553
| `githubServerId` | The id of the `<server>` entry describing the GitHub repository to resolve models from. | `String` | none | {nok}
541554
| `outputDirectory` | The path to the directory where the generated SQL script will be written to. | `String` | none | {ok}
542555
| `dialect` | The SQL dialect to generate for. | `String` | `databricks` | {nok}
@@ -592,6 +605,7 @@ Configuration Properties:
592605
| Property | Description | Type | Default Value | Required
593606
| `detailedValidationMessages` | Detailed validation messages if the model can not be loaded | `Boolean` | `false` | {nok}
594607
| `modelsRootDirectory` | The path to the root directory containing the Aspect Model file(s). | `String` | `$\{basedir}/src/main/resources/aspects` | {nok}
608+
| `githubServerIds` | A list of `githubServerId` values, each referring to a `<server>` entry in the Maven `settings.xml`, defining the GitHub repositories to resolve models from. | `List<String>` | none | {nok}
595609
| `githubServerId` | The id of the `<server>` entry describing the GitHub repository to resolve models from. | `String` | none | {nok}
596610
| `includes` | A list of Aspect Model URNs identifying the Aspect Models to be included in the plugin execution. | `String` | none | {ok}
597611
| `outputDirectory` | The path to the directory where the generated HTML document will be written to. | `String` | none | {ok}
@@ -642,6 +656,7 @@ Configuration Properties:
642656
| Property | Description | Type | Default Value | Required
643657
| `detailedValidationMessages` | Detailed validation messages if the model can not be loaded | `Boolean` | `false` | {nok}
644658
| `modelsRootDirectory` | The path to the root directory containing the Aspect Model file(s). | `String` | `$\{basedir}/src/main/resources/aspects` | {nok}
659+
| `githubServerIds` | A list of `githubServerId` values, each referring to a `<server>` entry in the Maven `settings.xml`, defining the GitHub repositories to resolve models from. | `List<String>` | none | {nok}
645660
| `githubServerId` | The id of the `<server>` entry describing the GitHub repository to resolve models from. | `String` | none | {nok}
646661
| `includes` | A list of Aspect Model URNs identifying the Aspect Models to be included in the plugin execution. | `String` | none | {ok}
647662
| `outputDirectory` | The path to the directory where the generated diagrams will be written to. | `String` | none | {ok}
@@ -689,6 +704,7 @@ Configuration Properties:
689704
| Property | Description | Type | Default Value | Required
690705
| `detailedValidationMessages` | Detailed validation messages if the model can not be loaded | `Boolean` | `false` | {nok}
691706
| `modelsRootDirectory` | The path to the root directory containing the Aspect Model file(s). | `String` | `$\{basedir}/src/main/resources/aspects` | {nok}
707+
| `githubServerIds` | A list of `githubServerId` values, each referring to a `<server>` entry in the Maven `settings.xml`, defining the GitHub repositories to resolve models from. | `List<String>` | none | {nok}
692708
| `githubServerId` | The id of the `<server>` entry describing the GitHub repository to resolve models from. | `String` | none | {nok}
693709
| `includes` | A list of Aspect Model URNs identifying the Aspect Models to be included in the plugin execution. | `String` | none | {ok}
694710
| `outputDirectory` | The path to the directory where the generated JSON payload will be written to. | `String` | none | {ok}
@@ -734,6 +750,7 @@ Configuration Properties:
734750
| Property | Description | Type | Default Value | Required
735751
| `detailedValidationMessages` | Detailed validation messages if the model can not be loaded | `Boolean` | `false` | {nok}
736752
| `modelsRootDirectory` | The path to the root directory containing the Aspect Model file(s). | `String` | `$\{basedir}/src/main/resources/aspects` | {nok}
753+
| `githubServerIds` | A list of `githubServerId` values, each referring to a `<server>` entry in the Maven `settings.xml`, defining the GitHub repositories to resolve models from. | `List<String>` | none | {nok}
737754
| `githubServerId` | The id of the `<server>` entry describing the GitHub repository to resolve models from. | `String` | none | {nok}
738755
| `includes` | A list of Aspect Model URNs identifying the Aspect Models to be included in the plugin execution. | `String` | none | {ok}
739756
| `outputDirectory` | The path to the directory where the generated JSON-LD will be written to. | `String` | none | {ok}
@@ -783,6 +800,7 @@ Configuration Properties:
783800
| Property | Description | Type | Default Value | Required
784801
| `detailedValidationMessages` | Detailed validation messages if the model can not be loaded | `Boolean` | `false` | {nok}
785802
| `modelsRootDirectory` | The path to the root directory containing the Aspect Model file(s). | `String` | `$\{basedir}/src/main/resources/aspects` | {nok}
803+
| `githubServerIds` | A list of `githubServerId` values, each referring to a `<server>` entry in the Maven `settings.xml`, defining the GitHub repositories to resolve models from. | `List<String>` | none | {nok}
786804
| `githubServerId` | The id of the `<server>` entry describing the GitHub repository to resolve models from. | `String` | none | {nok}
787805
| `includes` | A list of Aspect Model URNs identifying the Aspect Models to be included in the plugin execution. | `String` | none | {ok}
788806
| `outputDirectory` | The path to the directory containing the pretty printed Aspect Model. | `String` | none | {ok}
@@ -833,6 +851,7 @@ Configuration Properties:
833851
| Property | Description | Type | Default Value | Required
834852
| `detailedValidationMessages` | Detailed validation messages if the model can not be loaded | `Boolean` | `false` | {nok}
835853
| `modelsRootDirectory` | The path to the root directory containing the Aspect Model file(s). | `String` | `$\{basedir}/src/main/resources/aspects` | {nok}
854+
| `githubServerIds` | A list of `githubServerId` values, each referring to a `<server>` entry in the Maven `settings.xml`, defining the GitHub repositories to resolve models from. | `List<String>` | none | {nok}
836855
| `githubServerId` | The id of the `<server>` entry describing the GitHub repository to resolve models from. | `String` | none | {nok}
837856
| `includes` | A list of Aspect Model URNs identifying the Aspect Models to be included in the plugin execution. | `String` | none | {ok}
838857
| `outputDirectory` | The path to the directory where the generated AAS file will be written to. | `String` | none | {ok}

documentation/developer-guide/modules/tooling-guide/pages/samm-cli.adoc

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -281,9 +281,11 @@ to load. You can configure where such lookup should be done:
281281
* Using the `--github` switch, you can configure a location in a remote GitHub repository as models
282282
root, e.g., `eclipse-esmf/esmf-sdk`. Optionally, you can also provide `--github-directory` to set
283283
the remote directory and `--github-branch` or `--github-tag` to set the branch name or tag,
284-
respectively. If the repository is private, you can also pass `--github-token` and set a
285-
https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token[fine-grained
286-
access token]; the token needs at least "Contents" repository read permissions.
284+
respectively. If the repository is private, you can also pass `--token` to set the repository-specific GitHub token
285+
or `--github-token` for a token for repository/repositories.
286+
To generate a token, refer to the https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/managing-your-personal-access-tokens#creating-a-fine-grained-personal-access-token[fine-grained
287+
access token] documentation; the token must have at least "Contents" repository read permissions.
288+
287289

288290
NOTE: When using an Aspect Model URN as input to a command (such as
289291
`urn:samm:org.eclipse.esmf.example:1.0.0#Aspect`), you must also provide at least one of the

0 commit comments

Comments
 (0)