Gabriel39 commented on code in PR #70249:
URL: https://github.com/apache/doris/pull/70249#discussion_r4487570919


##########
fe/fe-connector/fe-connector-mongodb/pom.xml:
##########
@@ -0,0 +1,92 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+Licensed to the Apache Software Foundation (ASF) under one
+or more contributor license agreements.  See the NOTICE file
+distributed with this work for additional information
+regarding copyright ownership.  The ASF licenses this file
+to you under the Apache License, Version 2.0 (the
+"License"); you may not use this file except in compliance
+with the License.  You may obtain a copy of the License at
+
+  http://www.apache.org/licenses/LICENSE-2.0
+
+Unless required by applicable law or agreed to in writing,
+software distributed under the License is distributed on an
+"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+KIND, either express or implied.  See the License for the
+specific language governing permissions and limitations
+under the License.
+-->
+<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";>
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.doris</groupId>
+        <artifactId>fe-connector</artifactId>
+        <version>${revision}</version>
+        <relativePath>../pom.xml</relativePath>
+    </parent>
+    <artifactId>fe-connector-mongodb</artifactId>
+    <packaging>jar</packaging>
+    <name>Doris FE Connector - MongoDB Dependencies</name>
+    <description>Client dependency bundle for the native MongoDB 
connector.</description>
+    <properties>
+        <mongodb.driver.version>5.14.0</mongodb.driver.version>
+        <!-- Override the older FE-wide pin to reject oversized Snappy 
allocations and fix stream handling. -->
+        <mongodb.snappy-java.version>1.1.10.10</mongodb.snappy-java.version>
+        <mongodb.zstd-jni.version>1.5.7-25</mongodb.zstd-jni.version>
+    </properties>
+    <dependencyManagement>
+        <dependencies>
+            <!-- Align the sync driver, core and BSON without changing other 
plugins' closures. -->
+            <dependency>
+                <groupId>org.mongodb</groupId>
+                <artifactId>mongodb-driver-bom</artifactId>
+                <version>${mongodb.driver.version}</version>
+                <type>pom</type>
+                <scope>import</scope>
+            </dependency>
+        </dependencies>
+    </dependencyManagement>
+    <dependencies>
+        <dependency>
+            <groupId>org.mongodb</groupId>
+            <artifactId>mongodb-driver-sync</artifactId>

Review Comment:
   Checked on PR head `5123cfa610722eb39017ea061df1ba5333ba9928`. The 
optional-dependency premise does not apply to this version: the published 
[mongodb-driver-core 5.14.0 
POM](https://repo.maven.apache.org/maven2/org/mongodb/mongodb-driver-core/5.14.0/mongodb-driver-core-5.14.0.pom)
 declares `org.mongodb:bson-record-codec:5.14.0` with `scope=runtime` and no 
`optional=true`.
   
   It is therefore pulled in transitively through `mongodb-driver-sync -> 
mongodb-driver-core`. I also rebuilt the module with its target directory 
absent and inspected the resulting assembly: `lib/bson-record-codec-5.14.0.jar` 
is present among the six runtime dependency jars, both in the fresh build and 
after cache restoration.
   
   The README and license inventory match the packaged contents; an additional 
direct dependency is not required for this finding.



##########
build.sh:
##########
@@ -1348,6 +1350,10 @@ if [[ "${BUILD_FE}" -eq 1 ]]; then
     # Deploy connector provider plugins as independent plugin directories.
     # Each sub-directory is one connector backend loaded at runtime by 
ConnectorPluginManager.
     CONN_PLUGIN_DIR="${DORIS_OUTPUT}/fe/plugins/connector"
+    # Keep this dependency-only archive out of auto-discovery, which requires 
a provider class.
+    mkdir -p "${CONN_PLUGIN_DIR}"

Review Comment:
   Verified on unchanged PR head `5123cfa610722eb39017ea061df1ba5333ba9928`, 
using Maven Build Cache Extension 1.2.2 and the repository's existing cache 
configuration.
   
   The assembly ZIP is a Maven attached artifact (`assembly.attach` defaults to 
true). The generated cache `buildinfo.xml` explicitly records:
   
   ```xml
   <attachedArtifact>
     ...
     <type>zip</type>
     <filePath>target/doris-fe-connector-mongodb.zip</filePath>
   </attachedArtifact>
   ```
   
   I tested this with an isolated, initially empty local cache: package the 
module to seed the cache, move its entire `target/` directory away, then 
package again with caching enabled. The second run reports:
   
   ```text
   Found cached build, restoring org.apache.doris:fe-connector-mongodb
   Skipping plugin execution (cached): assembly:single
   BUILD SUCCESS
   ```
   
   The ZIP is restored at the exact path used by `build.sh`, with the same 
SHA-256 as the first build and all six runtime dependency jars intact. The 
original output directory was restored after the experiment.
   
   The "jar and nothing else" comment in the cache configuration is overly 
broad: it explains missing unregistered side outputs such as `target/lib`, but 
Maven attached artifacts are also restored. The proposed missing-ZIP failure 
does not occur in this test, so forcing assembly to run on cache hits is not 
needed. This validation covered scoped Maven packaging, not a full Doris build.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to