From 9993a85fa8e3fd39102aa4b6f1434cb07c3b2745 Mon Sep 17 00:00:00 2001 From: Aihua Xu Date: Wed, 7 Aug 2024 22:29:51 -0700 Subject: [PATCH] Generate conf.jar from the build and move persistence.xml to eclipselink project --- .../persistence/eclipselink/build.gradle.kts | 9 ++++++++- .../src/main}/resources/META-INF/persistence.xml | 2 +- .../src/test/data/eclipselink_conf.jar | Bin 1322 -> 0 bytes .../PolarisEclipseLinkMetaStoreTest.java | 2 +- .../src/test}/resources/META-INF/persistence.xml | 0 5 files changed, 10 insertions(+), 3 deletions(-) rename {polaris-service/src/test => extension/persistence/eclipselink/src/main}/resources/META-INF/persistence.xml (96%) delete mode 100644 extension/persistence/eclipselink/src/test/data/eclipselink_conf.jar rename {polaris-service/src/main => extension/persistence/eclipselink/src/test}/resources/META-INF/persistence.xml (100%) diff --git a/extension/persistence/eclipselink/build.gradle.kts b/extension/persistence/eclipselink/build.gradle.kts index fdad53db0..4fbb555de 100644 --- a/extension/persistence/eclipselink/build.gradle.kts +++ b/extension/persistence/eclipselink/build.gradle.kts @@ -37,4 +37,11 @@ dependencies { testRuntimeOnly("org.junit.platform:junit-platform-launcher") } -sourceSets { test { resources { srcDir("src/test/data") } } } +tasks.register("archiveConf") { + archiveFileName = "conf.jar" + destinationDirectory = layout.buildDirectory.dir("conf") + + from("src/test/resources/META-INF/") { include("persistence.xml") } +} + +tasks.named("test") { dependsOn("archiveConf") } diff --git a/polaris-service/src/test/resources/META-INF/persistence.xml b/extension/persistence/eclipselink/src/main/resources/META-INF/persistence.xml similarity index 96% rename from polaris-service/src/test/resources/META-INF/persistence.xml rename to extension/persistence/eclipselink/src/main/resources/META-INF/persistence.xml index db8c1c4bd..11828b284 100644 --- a/polaris-service/src/test/resources/META-INF/persistence.xml +++ b/extension/persistence/eclipselink/src/main/resources/META-INF/persistence.xml @@ -20,7 +20,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://java.sun.com/xml/ns/persistence http://java.sun.com/xml/ns/persistence/persistence_2_0.xsd"> - + org.eclipse.persistence.jpa.PersistenceProvider io.polaris.core.persistence.models.ModelEntity io.polaris.core.persistence.models.ModelEntityActive diff --git a/extension/persistence/eclipselink/src/test/data/eclipselink_conf.jar b/extension/persistence/eclipselink/src/test/data/eclipselink_conf.jar deleted file mode 100644 index 7f0a47fd7e9e1ebfa0a74e5226605141c954d286..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 1322 zcmWIWW@h1HVBlb2(2i$`WIzI(3@i-3t|5-Po_=on|4uP51OSzaFmP~iU?>#Zg7f0buK?pwji~r zIJ3AUH7_|;uOc^RX=q^aEjNL>=ixbDr<{opT3Gucz^5(gPL|Vw=7P&Mm3^0$&e^@w zD_3W^{IdT2ya}9s%Z$s;bnm!*H-G=#zgwjC+|O5ibHQri)zmL~FWnltUOTP$WV9P~i2sRdEeox7 z){s>W+;z%K=;W z$Br5gri5}WvvAV=v+U%hBo)~oca&aCO@DIc#N7*-weQ%@2;Y3R{o}nam$$5Y-D2t^ zoO?P%?r)6M*<+IBPyV;Qoai}aTfV@}koBTQyH5Xu?}784ip&0(qWgc&eZ7a5 zGd4<`opw{D{U_70&o@K2oq1+#6?-`2o1|UJ=GEK|Swg7?_ik*o4HQ|}7!k0&=!p8u z>%TmXOFl``wGdr;s%t98QniyS46>Wcv|}U|DHpl2FS)^WzNYwNtgA}5g_`9|gYxHw zJ#SU^#RKUM)mmt{JjH9O_xU8{S<%85?pqgfaXnsLpXYY{b=m!; z_4RX}nVi<`ZY`Q;d(84;`Pr`_pWEISZ$9+-&bj~hzrNdb@}B5L1CO_R{_F@k)SMK( zr>AGy87^`09o+|_m&rVCjCjM}cBb3YZhvf#dimv_6(*`H6mB+dtWsZb)_Ik=qh9Mm zv-zqX?|8lQ_RY(W`tMlPWy4f>a*j0D+$|<6bbgCuuI8Si_ftYn_-U&>&!yxm{mMNn z4$1D5OW&iI`{WI s3D=5L@_;OdnE)y&kR1jpDG*>ikcn1q1bDNuffO(U;VvK@#RB310QdbG^#A|> diff --git a/extension/persistence/eclipselink/src/test/java/io/polaris/extension/persistence/impl/eclipselink/PolarisEclipseLinkMetaStoreTest.java b/extension/persistence/eclipselink/src/test/java/io/polaris/extension/persistence/impl/eclipselink/PolarisEclipseLinkMetaStoreTest.java index 32b4169d6..19cea32cf 100644 --- a/extension/persistence/eclipselink/src/test/java/io/polaris/extension/persistence/impl/eclipselink/PolarisEclipseLinkMetaStoreTest.java +++ b/extension/persistence/eclipselink/src/test/java/io/polaris/extension/persistence/impl/eclipselink/PolarisEclipseLinkMetaStoreTest.java @@ -82,7 +82,7 @@ private static class CreateStoreSessionArgs implements ArgumentsProvider { public Stream provideArguments(ExtensionContext extensionContext) { return Stream.of( Arguments.of("META-INF/persistence.xml", true), - Arguments.of("eclipselink_conf.jar!/persistence.xml", true), + Arguments.of("./build/conf/conf.jar!/persistence.xml", true), Arguments.of("/dummy_path/conf.jar!/persistence.xml", false)); } } diff --git a/polaris-service/src/main/resources/META-INF/persistence.xml b/extension/persistence/eclipselink/src/test/resources/META-INF/persistence.xml similarity index 100% rename from polaris-service/src/main/resources/META-INF/persistence.xml rename to extension/persistence/eclipselink/src/test/resources/META-INF/persistence.xml