Skip to content

Commit

Permalink
fix(serverconf): Correct the hibernate-tools dependency (#1904)
Browse files Browse the repository at this point in the history
* build(serverconf): Correct the `hibernate-tools` dependency

As discovered by an analysis with ORT [1], the `hibernate-tools`
dependency does not exist in the currently set version "6.2.9.Final",
making the `:serverconf:schemaExport` Gradle task fail. It was only
available until version "5.6.15.Final", see [2]. The successor
providing `org.hibernate.tool.ant.HibernateToolTask` seems to be
`hibernate-tools-ant` [3], so use that instead.

However, this does not fully fix running `:serverconf:schemaExport` as
it still fails with

    * What went wrong:
    Execution failed for task ':serverconf:schemaExport'.
    > java.lang.NoClassDefFoundError: ee/ria/xroad/common/identifier/ClientId$Conf

which is something that needs to be investigated separately.

[1]: https://github.com/oss-review-toolkit/ort
[2]: https://mvnrepository.com/artifact/org.hibernate/hibernate-tools
[3]: https://mvnrepository.com/artifact/org.hibernate.tool/hibernate-tools-ant

Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>

* build(serverconf): Build the `common-util` project before exporting

Previsouly, running the `:serverconf:schemaExport` Gradle task failed if
the `:common:common-util` Gradle project was not built before. Fix this
by adding a dependency declaration.

Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>

* build(admin-service): Fix local dependencies on `niis-shared-ui` package

Use the correct syntax for dependencies on local packages so that
running `yarn install` succeeds even if the dependency has not been
built yet.

Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>

---------

Signed-off-by: Sebastian Schuberth <sebastian@doubleopen.org>
  • Loading branch information
sschuberth authored Dec 22, 2023
1 parent 5ba0b89 commit 01c1377
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 11 deletions.
2 changes: 1 addition & 1 deletion src/central-server/admin-service/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"dependencies": {
"@fontsource/open-sans": "^5.0.12",
"@mdi/font": "^7.2.96",
"@niis/shared-ui": "file:../../../shared-ui/niis-shared-ui-3.0.0.tgz",
"@niis/shared-ui": "../../../shared-ui",
"@vee-validate/i18n": "~4.11.6",
"@vee-validate/rules": "~4.11.6",
"axios": "~1.4.0",
Expand Down
8 changes: 4 additions & 4 deletions src/central-server/admin-service/ui/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -829,9 +829,9 @@ __metadata:
languageName: node
linkType: hard

"@niis/shared-ui@file:../../../shared-ui/niis-shared-ui-3.0.0.tgz::locator=xroad-centralserver-admin-ui%40workspace%3A.":
"@niis/shared-ui@file:../../../shared-ui::locator=xroad-centralserver-admin-ui%40workspace%3A.":
version: 3.0.0
resolution: "@niis/shared-ui@file:../../../shared-ui/niis-shared-ui-3.0.0.tgz#../../../shared-ui/niis-shared-ui-3.0.0.tgz::hash=94638d&locator=xroad-centralserver-admin-ui%40workspace%3A."
resolution: "@niis/shared-ui@file:../../../shared-ui#../../../shared-ui::hash=d30b31&locator=xroad-centralserver-admin-ui%40workspace%3A."
dependencies:
"@fontsource/open-sans": "npm:^5.0.12"
"@mdi/font": "npm:^7.2.96"
Expand All @@ -840,7 +840,7 @@ __metadata:
vue: ^3.3.4
vue-i18n: ^9.4.0
vuetify: ^3.3.19
checksum: efb5cbfa2bd2dd3fc7f385f23090d4d04f8752513ff64e7a1363a8f75b9666ebcae6f8f09cfcb67cfa8a2956b8fc66bfdaf1d7260e2238dcdacdf32399360ca1
checksum: 1700d63a338d7d4749d8e9176ca9974b018a7a8b77f190b06b584acff108fc6989a67133655cdee9d5bc85e8004c56681ac38672fd0a396364742c98c6200477
languageName: node
linkType: hard

Expand Down Expand Up @@ -5833,7 +5833,7 @@ __metadata:
"@fontsource/open-sans": "npm:^5.0.12"
"@intlify/eslint-plugin-vue-i18n": "npm:^2.0.0"
"@mdi/font": "npm:^7.2.96"
"@niis/shared-ui": "file:../../../shared-ui/niis-shared-ui-3.0.0.tgz"
"@niis/shared-ui": ../../../shared-ui
"@rushstack/eslint-patch": "npm:^1.3.3"
"@tsconfig/node18": "npm:^2.0.1"
"@types/node": "npm:^18.17.8"
Expand Down
2 changes: 1 addition & 1 deletion src/security-server/admin-service/ui/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
},
"dependencies": {
"@fontsource/open-sans": "~4.5.0",
"@niis/shared-ui": "file:../../../shared-ui/niis-shared-ui-3.0.0.tgz",
"@niis/shared-ui": "../../../shared-ui",
"@vee-validate/i18n": "~4.12.2",
"@vee-validate/rules": "~4.11.6",
"axios": "~1.4.0",
Expand Down
8 changes: 4 additions & 4 deletions src/security-server/admin-service/ui/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -760,9 +760,9 @@ __metadata:
languageName: node
linkType: hard

"@niis/shared-ui@file:../../../shared-ui/niis-shared-ui-3.0.0.tgz::locator=frontend%40workspace%3A.":
"@niis/shared-ui@file:../../../shared-ui::locator=frontend%40workspace%3A.":
version: 3.0.0
resolution: "@niis/shared-ui@file:../../../shared-ui/niis-shared-ui-3.0.0.tgz#../../../shared-ui/niis-shared-ui-3.0.0.tgz::hash=bd2153&locator=frontend%40workspace%3A."
resolution: "@niis/shared-ui@file:../../../shared-ui#../../../shared-ui::hash=d30b31&locator=frontend%40workspace%3A."
dependencies:
"@fontsource/open-sans": "npm:^5.0.12"
"@mdi/font": "npm:^7.2.96"
Expand All @@ -771,7 +771,7 @@ __metadata:
vue: ^3.3.4
vue-i18n: ^9.4.0
vuetify: ^3.3.19
checksum: f4a48b9c7621724e588b7f567a6d0ef6b019e5aff87b2edec18c895a79a56f1ee040735fe7db73bff16c1c8588b99862ec4fda18829e44b4c6222abb0ddd7153
checksum: 1700d63a338d7d4749d8e9176ca9974b018a7a8b77f190b06b584acff108fc6989a67133655cdee9d5bc85e8004c56681ac38672fd0a396364742c98c6200477
languageName: node
linkType: hard

Expand Down Expand Up @@ -2873,7 +2873,7 @@ __metadata:
"@fontsource/open-sans": "npm:~4.5.0"
"@intlify/eslint-plugin-vue-i18n": "npm:^2.0.0"
"@mdi/font": "npm:~6.5.95"
"@niis/shared-ui": "file:../../../shared-ui/niis-shared-ui-3.0.0.tgz"
"@niis/shared-ui": ../../../shared-ui
"@rushstack/eslint-patch": "npm:^1.3.3"
"@types/jest": "npm:^27.0.0"
"@types/node": "npm:^18.16.17"
Expand Down
4 changes: 3 additions & 1 deletion src/serverconf/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@ dependencies {
schema project(':common:common-util')
schema "org.apache.ant:ant:1.10.11"
schema "org.hibernate:hibernate-hikaricp:$hibernateVersion"
schema "org.hibernate:hibernate-tools:$hibernateVersion"
schema "org.hibernate.tool:hibernate-tools-ant:$hibernateVersion"
schema 'commons-collections:commons-collections:3.2.2'
schema "ch.qos.logback:logback-classic:${logbackVersion}"
schema "org.hsqldb:hsqldb:$hsqldbVersion"
}

task schemaExport() {
dependsOn configurations.schema

doLast {
ant.taskdef(name: 'schemaExport', classname: 'org.hibernate.tool.ant.HibernateToolTask', classpath: configurations.schema.asPath)

Expand Down

0 comments on commit 01c1377

Please sign in to comment.