|
23 | 23 | ~ "Portions Copyrighted [year] [name of copyright owner]" |
24 | 24 | ~ |
25 | 25 | ~ Portions Copyrighted 2024 3A Systems LLC. |
| 26 | + ~ Portions copyright 2026 3A Systems, LLC. |
26 | 27 | --> |
27 | 28 | <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> |
28 | 29 | <modelVersion>4.0.0</modelVersion> |
|
74 | 75 | <version>${project.version}</version> |
75 | 76 | </dependency> |
76 | 77 |
|
77 | | - <!-- Commons --> |
78 | | - |
79 | | - <!-- OrientDB --> |
| 78 | + <!-- OrientDB --> |
| 79 | + <!-- |
| 80 | + OrientDB and its transitive dependencies (jnr-*, jffi, jaxb-*, ...) are embedded |
| 81 | + into the openidm-repo-orientdb bundle (see Embed-Dependency below). They are |
| 82 | + scoped 'provided' so they (and their transitives) are not also deployed as |
| 83 | + standalone bundles by openidm-zip, where many of them either lack OSGi |
| 84 | + metadata (jffi has no Bundle-SymbolicName) or have unsatisfied OSGi |
| 85 | + requirements in the OpenIDM runtime (jnr-ffi → com.kenai.jffi, |
| 86 | + jaxb-core → jakarta.xml.bind 3.x). 'provided' deps are still on the |
| 87 | + compile/test classpath, so unit tests work. |
| 88 | + --> |
80 | 89 | <dependency> |
81 | 90 | <groupId>com.orientechnologies</groupId> |
82 | 91 | <artifactId>orientdb-core</artifactId> |
83 | 92 | <version>${orientdb.version}</version> |
| 93 | + <scope>provided</scope> |
84 | 94 | <exclusions> |
85 | 95 | <exclusion> |
86 | 96 | <groupId>org.xerial.snappy</groupId> |
87 | 97 | <artifactId>snappy-java</artifactId> |
88 | 98 | </exclusion> |
| 99 | + <!-- |
| 100 | + OrientDB 3.x pulls in GraalVM/Truffle for SQL JS scripting via the java11+ |
| 101 | + profile. These jars are not OSGi bundles and several of them |
| 102 | + (graal-sdk, regex, js-scriptengine, profiler, chromeinspector) do not even |
| 103 | + contain a META-INF/MANIFEST.MF entry, which causes Felix to abort with |
| 104 | + "FileNotFoundException: META-INF/MANIFEST.MF" during bundle install. |
| 105 | + OpenIDM does not use OrientDB's JS scripting, so they are excluded. |
| 106 | + --> |
| 107 | + <exclusion> |
| 108 | + <groupId>org.graalvm.sdk</groupId> |
| 109 | + <artifactId>graal-sdk</artifactId> |
| 110 | + </exclusion> |
| 111 | + <exclusion> |
| 112 | + <groupId>org.graalvm.truffle</groupId> |
| 113 | + <artifactId>truffle-api</artifactId> |
| 114 | + </exclusion> |
| 115 | + <exclusion> |
| 116 | + <groupId>org.graalvm.js</groupId> |
| 117 | + <artifactId>js</artifactId> |
| 118 | + </exclusion> |
| 119 | + <exclusion> |
| 120 | + <groupId>org.graalvm.js</groupId> |
| 121 | + <artifactId>js-scriptengine</artifactId> |
| 122 | + </exclusion> |
| 123 | + <exclusion> |
| 124 | + <groupId>org.graalvm.tools</groupId> |
| 125 | + <artifactId>profiler</artifactId> |
| 126 | + </exclusion> |
| 127 | + <exclusion> |
| 128 | + <groupId>org.graalvm.tools</groupId> |
| 129 | + <artifactId>chromeinspector</artifactId> |
| 130 | + </exclusion> |
| 131 | + <exclusion> |
| 132 | + <groupId>org.graalvm.regex</groupId> |
| 133 | + <artifactId>regex</artifactId> |
| 134 | + </exclusion> |
89 | 135 | </exclusions> |
90 | 136 | </dependency> |
91 | 137 | <dependency> |
92 | 138 | <groupId>com.orientechnologies</groupId> |
93 | 139 | <artifactId>orientdb-server</artifactId> |
94 | 140 | <version>${orientdb.version}</version> |
| 141 | + <scope>provided</scope> |
95 | 142 | <exclusions> |
96 | 143 | <exclusion> |
97 | 144 | <groupId>javax.activation</groupId> |
98 | 145 | <artifactId>activation</artifactId> |
99 | 146 | </exclusion> |
| 147 | + <!-- See orientdb-core above: excluded GraalVM transitive dependencies. --> |
| 148 | + <exclusion> |
| 149 | + <groupId>org.graalvm.sdk</groupId> |
| 150 | + <artifactId>graal-sdk</artifactId> |
| 151 | + </exclusion> |
| 152 | + <exclusion> |
| 153 | + <groupId>org.graalvm.truffle</groupId> |
| 154 | + <artifactId>truffle-api</artifactId> |
| 155 | + </exclusion> |
| 156 | + <exclusion> |
| 157 | + <groupId>org.graalvm.js</groupId> |
| 158 | + <artifactId>js</artifactId> |
| 159 | + </exclusion> |
| 160 | + <exclusion> |
| 161 | + <groupId>org.graalvm.js</groupId> |
| 162 | + <artifactId>js-scriptengine</artifactId> |
| 163 | + </exclusion> |
| 164 | + <exclusion> |
| 165 | + <groupId>org.graalvm.tools</groupId> |
| 166 | + <artifactId>profiler</artifactId> |
| 167 | + </exclusion> |
| 168 | + <exclusion> |
| 169 | + <groupId>org.graalvm.tools</groupId> |
| 170 | + <artifactId>chromeinspector</artifactId> |
| 171 | + </exclusion> |
| 172 | + <exclusion> |
| 173 | + <groupId>org.graalvm.regex</groupId> |
| 174 | + <artifactId>regex</artifactId> |
| 175 | + </exclusion> |
| 176 | + <!-- |
| 177 | + JAXB stack pulled in by orientdb-server for OServerConfiguration XML |
| 178 | + (de)serialization. OpenIDM's EmbeddedOServerService builds the OServer |
| 179 | + config programmatically (no XML), so JAXB is not needed at runtime. |
| 180 | + The jaxb bundles fail OSGi resolution because they require |
| 181 | + jakarta.xml.bind 3.0.x which is not provided by any other bundle in |
| 182 | + the OpenIDM runtime. |
| 183 | + --> |
| 184 | + <exclusion> |
| 185 | + <groupId>org.glassfish.jaxb</groupId> |
| 186 | + <artifactId>jaxb-runtime</artifactId> |
| 187 | + </exclusion> |
| 188 | + <exclusion> |
| 189 | + <groupId>org.glassfish.jaxb</groupId> |
| 190 | + <artifactId>jaxb-core</artifactId> |
| 191 | + </exclusion> |
| 192 | + <exclusion> |
| 193 | + <groupId>org.glassfish.jaxb</groupId> |
| 194 | + <artifactId>txw2</artifactId> |
| 195 | + </exclusion> |
| 196 | + <exclusion> |
| 197 | + <groupId>com.sun.istack</groupId> |
| 198 | + <artifactId>istack-commons-runtime</artifactId> |
| 199 | + </exclusion> |
| 200 | + <exclusion> |
| 201 | + <groupId>jakarta.xml.bind</groupId> |
| 202 | + <artifactId>jakarta.xml.bind-api</artifactId> |
| 203 | + </exclusion> |
100 | 204 | </exclusions> |
101 | 205 | </dependency> |
102 | | - <dependency> |
103 | | - <groupId>com.orientechnologies</groupId> |
104 | | - <artifactId>orientdb-enterprise</artifactId> |
105 | | - <version>${orientdb.version}</version> |
106 | | - </dependency> |
107 | 206 | <dependency> |
108 | 207 | <groupId>net.java.dev.jna</groupId> |
109 | 208 | <artifactId>jna</artifactId> |
|
158 | 257 | <extensions>true</extensions> |
159 | 258 | <configuration> |
160 | 259 | <instructions> |
161 | | - <Embed-Dependency>persistence-api;scope=provided</Embed-Dependency> |
| 260 | + <!-- |
| 261 | + Embed only the OrientDB core/server jars and the JNR/jffi |
| 262 | + stack into this bundle. These artifacts are NOT OSGi bundles |
| 263 | + (OrientDB jars lack Bundle-SymbolicName; jffi lacks any OSGi |
| 264 | + metadata at all), so installing them as standalone bundles in |
| 265 | + openidm/bundle/ fails OSGi resolution. Embedding them here |
| 266 | + keeps the bundle self-contained. |
| 267 | +
|
| 268 | + JNA is excluded because it is already a proper OSGi bundle and |
| 269 | + is deployed standalone via openidm-zip's runtime scope. |
| 270 | +
|
| 271 | + Embed-Transitive is intentionally false to avoid accidentally |
| 272 | + embedding unrelated artifacts (e.g. osgi.core or other |
| 273 | + openidm-* bundles) which would cause ClassCastExceptions at |
| 274 | + runtime due to duplicate classes loaded by different |
| 275 | + classloaders. |
| 276 | + --> |
| 277 | + <Embed-Dependency>*;groupId=com.orientechnologies|com.github.jnr|com.googlecode.concurrentlinkedhashmap|at.yawk.lz4;inline=false</Embed-Dependency> |
| 278 | + <Embed-Transitive>true</Embed-Transitive> |
162 | 279 | <Export-Package>org.forgerock.openidm.repo.orientdb.metadata;version=${project.version}</Export-Package> |
163 | 280 | <Private-Package>org.forgerock.openidm.repo.orientdb.impl.*</Private-Package> |
164 | 281 | <Bundle-Activator>org.forgerock.openidm.repo.orientdb.impl.Activator</Bundle-Activator> |
| 282 | + <!-- |
| 283 | + The embedded OrientDB and JNR code references many |
| 284 | + optional/platform-specific packages (graalvm, truffle, |
| 285 | + jakarta.xml.bind, com.sun.management, ...) that are not |
| 286 | + present in the OpenIDM runtime. Marking imports optional |
| 287 | + lets the bundle resolve and start without them. |
| 288 | + --> |
| 289 | + <Import-Package>*;resolution:=optional</Import-Package> |
| 290 | + <DynamicImport-Package>*</DynamicImport-Package> |
165 | 291 | </instructions> |
166 | 292 | </configuration> |
167 | 293 | </plugin> |
|
0 commit comments