This is an automated email from the ASF dual-hosted git repository.

SemyonSinchenko pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-graphar.git


The following commit(s) were added to refs/heads/main by this push:
     new 8ae0fc1a build(java): make the Java SDK modules publishable to the ASF 
Nexus (#980)
8ae0fc1a is described below

commit 8ae0fc1afd2e58ac0d603583f375c477581f7cdc
Author: alex <[email protected]>
AuthorDate: Thu Nov 12 22:57:53 2026 +0300

    build(java): make the Java SDK modules publishable to the ASF Nexus (#980)
    
    The SDK modules declare their version through ${graphar.version} and
    inherit from an unpublished root, so an installed POM cannot be resolved
    by a consumer. Flatten the SDK module POMs and the root POM so published
    POMs carry concrete versions and no parent, add the project SCM, issue
    tracker and developers that the repository metadata needs, and bundle the
    incubator DISCLAIMER into every jar next to LICENSE and NOTICE.
    
    Add a snapshot workflow that tests and deploys the SDK modules to the ASF
    snapshot repository on pushes to main, with a dry-run dispatch. It uses
    the NEXUS_USER and NEXUS_PW secrets that ASF Infra provisions per
    repository.
---
 .github/workflows/java-sdk-snapshot.yml | 97 +++++++++++++++++++++++++++++++++
 .gitignore                              |  3 +
 maven-projects/core/pom.xml             |  4 ++
 maven-projects/info/pom.xml             |  4 ++
 maven-projects/io-api/pom.xml           |  4 ++
 maven-projects/pom.xml                  | 79 +++++++++++++++++++++++----
 maven-projects/storage-api/pom.xml      |  4 ++
 maven-projects/storage-local/pom.xml    |  4 ++
 maven-projects/storage-s3/pom.xml       |  4 ++
 9 files changed, 193 insertions(+), 10 deletions(-)

diff --git a/.github/workflows/java-sdk-snapshot.yml 
b/.github/workflows/java-sdk-snapshot.yml
new file mode 100644
index 00000000..a2abdc5c
--- /dev/null
+++ b/.github/workflows/java-sdk-snapshot.yml
@@ -0,0 +1,97 @@
+# 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.
+
+name: GraphAr Java SDK Snapshot
+
+on:
+  push:
+    branches:
+      - main
+    paths:
+      - 'maven-projects/pom.xml'
+      - 'maven-projects/info/**'
+      - 'maven-projects/storage-api/**'
+      - 'maven-projects/storage-local/**'
+      - 'maven-projects/storage-s3/**'
+      - 'maven-projects/io-api/**'
+      - 'maven-projects/core/**'
+      - '.github/workflows/java-sdk-snapshot.yml'
+  workflow_dispatch:
+    inputs:
+      dry_run:
+        description: 'Build and install the snapshot jars without deploying 
them to the ASF Nexus'
+        type: boolean
+        default: false
+
+concurrency:
+  group: ${{ github.workflow }}
+  cancel-in-progress: false
+
+permissions:
+  contents: read
+
+jobs:
+  deploy:
+    if: github.repository == 'apache/incubator-graphar' || inputs.dry_run
+    runs-on: ubuntu-latest
+    env:
+      SDK_MODULES: info,storage-api,storage-local,io-api,storage-s3,core
+    steps:
+      - uses: actions/checkout@v7
+        with:
+          submodules: true
+
+      - name: Cache Maven repository
+        uses: actions/cache@v6
+        with:
+          path: ~/.m2/repository
+          key: ${{ runner.os }}-maven-sdk-snapshot-${{ 
hashFiles('maven-projects/**/pom.xml') }}
+          restore-keys: |
+            ${{ runner.os }}-maven-sdk-snapshot-
+
+      - name: Configure ASF Nexus credentials
+        if: ${{ !inputs.dry_run }}
+        run: |
+          mkdir -p ~/.m2
+          cat > ~/.m2/settings.xml <<'SETTINGS'
+          <settings>
+            <servers>
+              <server>
+                <id>apache.snapshots.https</id>
+                <username>${env.NEXUS_USER}</username>
+                <password>${env.NEXUS_PW}</password>
+              </server>
+            </servers>
+          </settings>
+          SETTINGS
+
+      - name: Test and publish the SDK snapshot
+        working-directory: maven-projects
+        env:
+          NEXUS_USER: ${{ secrets.NEXUS_USER }}
+          NEXUS_PW: ${{ secrets.NEXUS_PW }}
+          GOAL: ${{ inputs.dry_run && 'install' || 'deploy' }}
+        run: |
+          set -euo pipefail
+          export JAVA_HOME=${JAVA_HOME_11_X64}
+          version=$(mvn --no-transfer-progress -q -N help:evaluate 
-Dexpression=project.version -DforceStdout)
+          case "$version" in
+            *-SNAPSHOT) ;;
+            *) echo "Refusing to publish non-SNAPSHOT version $version"; exit 
1 ;;
+          esac
+          echo "Publishing $version from $(git rev-parse --short HEAD)"
+          mvn --no-transfer-progress -pl ${SDK_MODULES} -am clean ${GOAL} 
-Dspotless.check.skip=true
diff --git a/.gitignore b/.gitignore
index 8e0a539b..6ba1bf46 100644
--- a/.gitignore
+++ b/.gitignore
@@ -82,3 +82,6 @@ dependency-reduced-pom.xml
 
 # Vibe coding
 CLAUDE.md
+
+# Maven flatten plugin output
+.flattened-pom.xml
diff --git a/maven-projects/core/pom.xml b/maven-projects/core/pom.xml
index 529ae756..83424a8d 100644
--- a/maven-projects/core/pom.xml
+++ b/maven-projects/core/pom.xml
@@ -58,6 +58,10 @@
 
     <build>
         <plugins>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>flatten-maven-plugin</artifactId>
+            </plugin>
             <plugin>
                 <groupId>com.diffplug.spotless</groupId>
                 <artifactId>spotless-maven-plugin</artifactId>
diff --git a/maven-projects/info/pom.xml b/maven-projects/info/pom.xml
index ebd5d017..fe41c449 100644
--- a/maven-projects/info/pom.xml
+++ b/maven-projects/info/pom.xml
@@ -63,6 +63,10 @@
 
     <build>
         <plugins>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>flatten-maven-plugin</artifactId>
+            </plugin>
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-shade-plugin</artifactId>
diff --git a/maven-projects/io-api/pom.xml b/maven-projects/io-api/pom.xml
index 971f3090..38ae6b07 100644
--- a/maven-projects/io-api/pom.xml
+++ b/maven-projects/io-api/pom.xml
@@ -55,6 +55,10 @@
 
     <build>
         <plugins>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>flatten-maven-plugin</artifactId>
+            </plugin>
             <plugin>
                 <groupId>com.diffplug.spotless</groupId>
                 <artifactId>spotless-maven-plugin</artifactId>
diff --git a/maven-projects/pom.xml b/maven-projects/pom.xml
index 704e0512..ff0d44a1 100644
--- a/maven-projects/pom.xml
+++ b/maven-projects/pom.xml
@@ -60,19 +60,31 @@
             <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
         </license>
     </licenses>
-    <!--    <issueManagement>
-            <system>GitHub</system>
-            <url>https://github.com/apache/graphar/issues</url>
-        </issueManagement>
-        <scm>
-            
<connection>scm:git:https://github.com/apache/graphar.git</connection>
-            
<developerConnection>scm:git:https://github.com/apache/graphar.git</developerConnection>
-            <tag>HEAD</tag>
-            <url>https://github.com/apache/graphar</url>
-        </scm>-->
+    <developers>
+        <developer>
+            <id>graphar</id>
+            <name>Apache GraphAr developers</name>
+            <email>[email protected]</email>
+            <url>https://graphar.apache.org/</url>
+            <organization>The Apache Software Foundation</organization>
+            <organizationUrl>https://www.apache.org/</organizationUrl>
+        </developer>
+    </developers>
+    <issueManagement>
+        <system>GitHub</system>
+        <url>https://github.com/apache/incubator-graphar/issues</url>
+    </issueManagement>
+    <scm>
+        
<connection>scm:git:https://github.com/apache/incubator-graphar.git</connection>
+        
<developerConnection>scm:git:https://github.com/apache/incubator-graphar.git</developerConnection>
+        <tag>HEAD</tag>
+        <url>https://github.com/apache/incubator-graphar</url>
+    </scm>
     <properties>
         <graphar.version>0.13.0-SNAPSHOT</graphar.version>
         <spotless-maven-plugin.version>2.20.0</spotless-maven-plugin.version>
+        <flatten-maven-plugin.version>1.6.0</flatten-maven-plugin.version>
+        
<apache-incubator-disclaimer-resource-bundle.version>1.7</apache-incubator-disclaimer-resource-bundle.version>
     </properties>
     <modules>
         <module>java</module>
@@ -94,7 +106,54 @@
                     <artifactId>spotless-maven-plugin</artifactId>
                     <version>${spotless-maven-plugin.version}</version>
                 </plugin>
+                <plugin>
+                    <groupId>org.codehaus.mojo</groupId>
+                    <artifactId>flatten-maven-plugin</artifactId>
+                    <version>${flatten-maven-plugin.version}</version>
+                    <configuration>
+                        <flattenMode>oss</flattenMode>
+                        <updatePomFile>true</updatePomFile>
+                    </configuration>
+                    <executions>
+                        <execution>
+                            <id>flatten</id>
+                            <phase>process-resources</phase>
+                            <goals>
+                                <goal>flatten</goal>
+                            </goals>
+                        </execution>
+                        <execution>
+                            <id>flatten-clean</id>
+                            <phase>clean</phase>
+                            <goals>
+                                <goal>clean</goal>
+                            </goals>
+                        </execution>
+                    </executions>
+                </plugin>
             </plugins>
         </pluginManagement>
+        <plugins>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>flatten-maven-plugin</artifactId>
+                <inherited>false</inherited>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-remote-resources-plugin</artifactId>
+                <executions>
+                    <execution>
+                        <id>process-resource-bundles</id>
+                        <configuration>
+                            <resourceBundles>
+                                
<resourceBundle>org.apache.apache.resources:apache-jar-resource-bundle:${version.apache-resource-bundles}</resourceBundle>
+                                
<resourceBundle>org.apache.apache.resources:apache-incubator-disclaimer-resource-bundle:${apache-incubator-disclaimer-resource-bundle.version}</resourceBundle>
+                            </resourceBundles>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
+        </plugins>
     </build>
 </project>
diff --git a/maven-projects/storage-api/pom.xml 
b/maven-projects/storage-api/pom.xml
index 68489bf4..e71e2968 100644
--- a/maven-projects/storage-api/pom.xml
+++ b/maven-projects/storage-api/pom.xml
@@ -55,6 +55,10 @@
 
     <build>
         <plugins>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>flatten-maven-plugin</artifactId>
+            </plugin>
             <plugin>
                 <groupId>com.diffplug.spotless</groupId>
                 <artifactId>spotless-maven-plugin</artifactId>
diff --git a/maven-projects/storage-local/pom.xml 
b/maven-projects/storage-local/pom.xml
index f3df2e4a..96ac5599 100644
--- a/maven-projects/storage-local/pom.xml
+++ b/maven-projects/storage-local/pom.xml
@@ -60,6 +60,10 @@
 
     <build>
         <plugins>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>flatten-maven-plugin</artifactId>
+            </plugin>
             <plugin>
                 <groupId>com.diffplug.spotless</groupId>
                 <artifactId>spotless-maven-plugin</artifactId>
diff --git a/maven-projects/storage-s3/pom.xml 
b/maven-projects/storage-s3/pom.xml
index 98ac2b2d..e25110c1 100644
--- a/maven-projects/storage-s3/pom.xml
+++ b/maven-projects/storage-s3/pom.xml
@@ -59,6 +59,10 @@
     </dependencies>
     <build>
         <plugins>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>flatten-maven-plugin</artifactId>
+            </plugin>
             <plugin>
                 <groupId>com.diffplug.spotless</groupId>
                 <artifactId>spotless-maven-plugin</artifactId>


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

Reply via email to