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

nicholasjiang pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/paimon-webui.git


The following commit(s) were added to refs/heads/main by this push:
     new 6f6d8c8c [Feature] Use assembly to build source code via release 
profile (#263)
6f6d8c8c is described below

commit 6f6d8c8c37e2c0232bddc51e7990f549ba1e4528
Author: yangyang zhong <[email protected]>
AuthorDate: Sat Jun 8 10:44:07 2024 +0800

    [Feature] Use assembly to build source code via release profile (#263)
---
 .gitignore                                         |  3 +-
 paimon-web-dist/pom.xml                            | 88 ++++++++++++++++++++++
 .../src/main/assembly/paimon-web-bin.xml           | 44 +++++++++++
 .../src/main/assembly/paimon-web-src.xml           | 86 +++++++++++++++++++++
 paimon-web-server/pom.xml                          | 34 ++-------
 .../{package.xml => paimon-web-server.xml}         | 30 +++-----
 paimon-web-server/src/main/bin/env.sh              | 29 +++++++
 paimon-web-server/src/main/bin/start.sh            | 49 ++++++++++++
 paimon-web-ui/pom.xml                              |  8 +-
 pom.xml                                            |  1 +
 10 files changed, 323 insertions(+), 49 deletions(-)

diff --git a/.gitignore b/.gitignore
index abbbee71..b96d7992 100644
--- a/.gitignore
+++ b/.gitignore
@@ -24,6 +24,7 @@ paimon-web-ui/components.d.ts
 paimon-web-ui/.eslintrc-auto-import.json
 paimon-web-ui/httpData
 paimon-web-ui/apiWeb.json
+paimon-web-server/src/main/resources/static/**
 logs/*
 .mvn/
 .www
@@ -43,7 +44,7 @@ target
 dependency-reduced-pom.xml
 *.dependency-reduced-pom.xml
 !.idea/paimon.svg
-
+**/dist/**
 # Logs
 logs
 *.log
diff --git a/paimon-web-dist/pom.xml b/paimon-web-dist/pom.xml
new file mode 100644
index 00000000..6e7aaf7a
--- /dev/null
+++ b/paimon-web-dist/pom.xml
@@ -0,0 +1,88 @@
+<?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.paimon</groupId>
+        <artifactId>paimon-webui</artifactId>
+        <version>0.1-SNAPSHOT</version>
+    </parent>
+
+    <artifactId>paimon-web-dist</artifactId>
+    <name>Paimon : Web : Dist</name>
+
+    <dependencies>
+        <dependency>
+            <groupId>org.apache.paimon</groupId>
+            <artifactId>paimon-web-server</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+    </dependencies>
+
+    <build>
+        <finalName>apache-paimon-webui-${project.version}</finalName>
+    </build>
+
+    <profiles>
+        <profile>
+            <id>release</id>
+            <build>
+                <plugins>
+                    <plugin>
+                        <artifactId>maven-assembly-plugin</artifactId>
+                        <executions>
+                            <execution>
+                                <id>paimon-web-bin</id>
+                                <goals>
+                                    <goal>single</goal>
+                                </goals>
+                                <phase>package</phase>
+
+                                <configuration>
+                                    <descriptors>
+                                        
<descriptor>src/main/assembly/paimon-web-bin.xml</descriptor>
+                                    </descriptors>
+                                    <appendAssemblyId>true</appendAssemblyId>
+                                </configuration>
+                            </execution>
+
+                            <execution>
+                                <id>src</id>
+                                <goals>
+                                    <goal>single</goal>
+                                </goals>
+                                <phase>package</phase>
+                                <configuration>
+                                    <descriptors>
+                                        
<descriptor>src/main/assembly/paimon-web-src.xml</descriptor>
+                                    </descriptors>
+                                    <appendAssemblyId>true</appendAssemblyId>
+                                </configuration>
+                            </execution>
+
+                        </executions>
+                    </plugin>
+                </plugins>
+            </build>
+        </profile>
+    </profiles>
+
+</project>
\ No newline at end of file
diff --git a/paimon-web-dist/src/main/assembly/paimon-web-bin.xml 
b/paimon-web-dist/src/main/assembly/paimon-web-bin.xml
new file mode 100644
index 00000000..d98699ba
--- /dev/null
+++ b/paimon-web-dist/src/main/assembly/paimon-web-bin.xml
@@ -0,0 +1,44 @@
+<!--
+  ~ 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.
+  -->
+
+<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.1.0";
+          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+          xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.1.0 
http://maven.apache.org/xsd/assembly-2.1.0.xsd";>
+    <id>bin</id>
+    <formats>
+        <format>tar.gz</format>
+    </formats>
+    <includeBaseDirectory>true</includeBaseDirectory>
+    <baseDirectory>${project.build.finalName}-bin</baseDirectory>
+
+    <fileSets>
+        <fileSet>
+            
<directory>${basedir}/../paimon-web-server/target/paimon-web-server</directory>
+            <outputDirectory>.</outputDirectory>
+        </fileSet>
+        <fileSet>
+            <directory>${basedir}/../script/sql</directory>
+            <outputDirectory>conf/sql</outputDirectory>
+            <fileMode>0755</fileMode>
+            <directoryMode>0755</directoryMode>
+        </fileSet>
+        <fileSet>
+            <directory>${basedir}/release-docs</directory>
+            <outputDirectory>.</outputDirectory>
+        </fileSet>
+    </fileSets>
+</assembly>
\ No newline at end of file
diff --git a/paimon-web-dist/src/main/assembly/paimon-web-src.xml 
b/paimon-web-dist/src/main/assembly/paimon-web-src.xml
new file mode 100644
index 00000000..4259545a
--- /dev/null
+++ b/paimon-web-dist/src/main/assembly/paimon-web-src.xml
@@ -0,0 +1,86 @@
+<!--
+  ~ 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.
+  -->
+
+<assembly
+        
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0";
+        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance";
+        
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0
 http://maven.apache.org/xsd/assembly-1.1.0.xsd";>
+    <id>src</id>
+    <formats>
+        <format>tar.gz</format>
+    </formats>
+    <includeBaseDirectory>true</includeBaseDirectory>
+    <baseDirectory>${project.build.finalName}-src</baseDirectory>
+
+    <fileSets>
+        <fileSet>
+            <directory>${basedir}/../</directory>
+            <useDefaultExcludes>true</useDefaultExcludes>
+            <includes>
+                <include>**/*</include>
+            </includes>
+            <excludes>
+                <!-- github ignore -->
+                <exclude>**/.github/**</exclude>
+                <exclude>.travis.yml</exclude>
+
+                <!-- maven ignore -->
+                <exclude>**/target/**</exclude>
+                <exclude>**/*.class</exclude>
+                <exclude>**/*.jar</exclude>
+                <exclude>**/*.war</exclude>
+                <exclude>**/*.zip</exclude>
+                <exclude>**/*.tar</exclude>
+                <exclude>**/*.tar.gz</exclude>
+                <exclude>**/node/**</exclude>
+                <exclude>**/node_modules/**</exclude>
+                <exclude>**/dist/**</exclude>
+
+                <!-- maven plugin ignore -->
+                <exclude>release.properties</exclude>
+                <exclude>**/pom.xml.releaseBackup</exclude>
+                <exclude>*.gpg</exclude>
+
+                <!-- node ignore -->
+                <exclude>**/paimon-ui/dist/**</exclude>
+                <exclude>**/paimon-ui/node/**</exclude>
+                <exclude>**/paimon-ui/node_modules/**</exclude>
+
+                <!-- eclipse ignore -->
+                <exclude>**/.settings/**</exclude>
+                <exclude>**/.project</exclude>
+                <exclude>**/.classpath</exclude>
+
+                <!-- idea ignore -->
+                <exclude>**/.idea/**</exclude>
+                <exclude>**/*.ipr</exclude>
+                <exclude>**/*.iml</exclude>
+                <exclude>**/*.iws</exclude>
+
+                <!-- temp ignore -->
+                <exclude>**/logs/**</exclude>
+                <exclude>**/*.log</exclude>
+                <exclude>**/*.doc</exclude>
+                <exclude>**/*.cache</exclude>
+                <exclude>**/*.diff</exclude>
+                <exclude>**/*.patch</exclude>
+                <exclude>**/*.tmp</exclude>
+
+            </excludes>
+        </fileSet>
+    </fileSets>
+</assembly>
diff --git a/paimon-web-server/pom.xml b/paimon-web-server/pom.xml
index ebd3c7f1..98aa516f 100644
--- a/paimon-web-server/pom.xml
+++ b/paimon-web-server/pom.xml
@@ -58,6 +58,12 @@ under the License.
             <version>${project.version}</version>
         </dependency>
 
+        <dependency>
+            <groupId>org.apache.paimon</groupId>
+            <artifactId>paimon-web-ui</artifactId>
+            <version>${project.version}</version>
+        </dependency>
+
         <dependency>
             <groupId>cn.hutool</groupId>
             <artifactId>hutool-all</artifactId>
@@ -256,7 +262,7 @@ under the License.
                 <directory>${project.basedir}/src/test/resources</directory>
             </testResource>
         </testResources>
-        <finalName>${project.artifactId}-${project.version}</finalName>
+        <finalName>${project.artifactId}</finalName>
         <resources>
             <resource>
                 <filtering>true</filtering>
@@ -309,7 +315,7 @@ under the License.
                 <configuration>
                     <appendAssemblyId>false</appendAssemblyId>
                     <descriptors>
-                        <descriptor>src/main/assembly/package.xml</descriptor>
+                        
<descriptor>src/main/assembly/paimon-web-server.xml</descriptor>
                     </descriptors>
                 </configuration>
                 <executions>
@@ -323,30 +329,6 @@ under the License.
                 </executions>
             </plugin>
 
-            <plugin>
-                <groupId>org.apache.maven.plugins</groupId>
-                <artifactId>maven-resources-plugin</artifactId>
-                <version>${maven.resource.version}</version>
-                <executions>
-                    <execution>
-                        <id>copy-static</id>
-                        <goals>
-                            <goal>copy-resources</goal>
-                        </goals>
-                        <phase>initialize</phase>
-                        <configuration>
-                            
<outputDirectory>src/main/resources/static</outputDirectory>
-                            <overwrite>true</overwrite>
-                            <resources>
-                                <resource>
-                                    
<directory>../paimon-web-ui/dist</directory>
-                                </resource>
-                            </resources>
-                        </configuration>
-                    </execution>
-                </executions>
-            </plugin>
-
             <plugin>
                 <groupId>org.apache.maven.plugins</groupId>
                 <artifactId>maven-jar-plugin</artifactId>
diff --git a/paimon-web-server/src/main/assembly/package.xml 
b/paimon-web-server/src/main/assembly/paimon-web-server.xml
similarity index 68%
rename from paimon-web-server/src/main/assembly/package.xml
rename to paimon-web-server/src/main/assembly/paimon-web-server.xml
index accab465..7a6988e2 100644
--- a/paimon-web-server/src/main/assembly/package.xml
+++ b/paimon-web-server/src/main/assembly/paimon-web-server.xml
@@ -17,49 +17,39 @@ specific language governing permissions and limitations
 under the License.
 -->
 <assembly>
-    <id>dist</id>
+    <id>server</id>
     <formats>
         <format>dir</format>
     </formats>
     <includeBaseDirectory>false</includeBaseDirectory>
     <fileSets>
-<!--        <fileSet>-->
-<!--            <directory>${basedir}/src/main/bin</directory>-->
-<!--            <lineEnding>unix</lineEnding>-->
-<!--            <outputDirectory>service</outputDirectory>-->
-<!--            <includes>-->
-<!--                <include>*.service</include>-->
-<!--            </includes>-->
-<!--        </fileSet>-->
         <fileSet>
             <directory>${basedir}/src/main/bin</directory>
             <lineEnding>unix</lineEnding>
-            <outputDirectory/>
+            <outputDirectory>bin</outputDirectory>
             <fileMode>755</fileMode>
             <includes>
                 <include>*.sh</include>
             </includes>
         </fileSet>
-        <fileSet>
-            <directory>${basedir}/src/main/bin</directory>
-            <lineEnding>windows</lineEnding>
-            <outputDirectory/>
-            <includes>
-                <include>*.bat</include>
-            </includes>
-        </fileSet>
+
         <fileSet>
             <directory>target/classes</directory>
             <outputDirectory>config</outputDirectory>
             <includes>
                 <include>**/*.yml</include>
-                <include>**/log4j2.xml</include>
+                <include>**/log4j2-spring.xml</include>
+                <include>**/*.properties</include>
             </includes>
         </fileSet>
+        <fileSet>
+            <directory>${basedir}/../paimon-web-ui/dist</directory>
+            <outputDirectory>./ui</outputDirectory>
+        </fileSet>
     </fileSets>
     <dependencySets>
         <dependencySet>
-            <outputDirectory>lib</outputDirectory>
+            <outputDirectory>libs</outputDirectory>
             <unpack>false</unpack>
         </dependencySet>
     </dependencySets>
diff --git a/paimon-web-server/src/main/bin/env.sh 
b/paimon-web-server/src/main/bin/env.sh
new file mode 100644
index 00000000..1419a868
--- /dev/null
+++ b/paimon-web-server/src/main/bin/env.sh
@@ -0,0 +1,29 @@
+#!/bin/bash
+#
+# 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.
+#
+
+# Set the FLINK_HOME directory to execute the flink command to submit the cdc 
job.
+FLINK_HOME=
+
+# Set the ACTION_JAR_PATH to execute the paimon action job.
+ACTION_JAR_PATH=
+
+JVM_ARGS="-server"
+
+JAVA_OPTS=${JAVA_OPTS:-"${JVM_ARGS}"}
+
+JAVA_HOME=
\ No newline at end of file
diff --git a/paimon-web-server/src/main/bin/start.sh 
b/paimon-web-server/src/main/bin/start.sh
new file mode 100644
index 00000000..e627ec22
--- /dev/null
+++ b/paimon-web-server/src/main/bin/start.sh
@@ -0,0 +1,49 @@
+#!/bin/bash
+#
+# 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.
+#
+
+PAIMON_UI_HOME="${PAIMON_UI_HOME:-$(pwd)}"
+source ${PAIMON_UI_HOME}/bin/env.sh
+
+if [[ "$DOCKER" == "true" ]]; then
+  JAVA_OPTS="${JAVA_OPTS} -XX:-UseContainerSupport"
+fi
+
+echo "JAVA_HOME=${JAVA_HOME}"
+echo "JAVA_OPTS=${JAVA_OPTS}"
+echo "PAIMON_UI_HOME=${PAIMON_UI_HOME}"
+echo "FLINK_HOME=${PAIMON_UI_HOME}"
+echo "ACTION_JAR_PATH=${PAIMON_UI_HOME}"
+
+if [ -z "$PAIMON_UI_HOME" ]; then
+    echo "PAIMON_UI_HOME is null, exit..."
+    exit 1
+fi
+if [ -z "$JAVA_HOME" ]; then
+      echo "JAVA_HOME is null, exit..."
+      exit 1
+fi
+if [ -z "$FLINK_HOME" ]; then
+    echo "FLINK_HOME is null, CDC cannot be used normally!"
+fi
+if [ -z "$ACTION_JAR_PATH" ]; then
+    echo "ACTION_JAR_PATH is null, CDC cannot be used normally!"
+fi
+
+$JAVA_HOME/bin/java $JAVA_OPTS \
+  -cp "$PAIMON_UI_HOME/conf":"$PAIMON_UI_HOME/libs/*" \
+   org.apache.paimon.web.server.PaimonWebServerApplication
\ No newline at end of file
diff --git a/paimon-web-ui/pom.xml b/paimon-web-ui/pom.xml
index 4ea96da4..427abfab 100644
--- a/paimon-web-ui/pom.xml
+++ b/paimon-web-ui/pom.xml
@@ -29,18 +29,19 @@ under the License.
     </parent>
 
     <artifactId>paimon-web-ui</artifactId>
-    <packaging>pom</packaging>
+<!--    <packaging>pom</packaging>-->
     <name>Paimon : Web : UI</name>
 
     <properties>
         <node.version>v18.0.0</node.version>
         <npm.version>9.4.1</npm.version>
         <frontend-maven-plugin.version>1.12.0</frontend-maven-plugin.version>
+        <build.ui.skip>false</build.ui.skip>
     </properties>
 
     <profiles>
         <profile>
-            <id>web</id>
+            <id>release</id>
             <build>
                 <finalName>${project.artifactId}-${project.version}</finalName>
                 <plugins>
@@ -48,6 +49,9 @@ under the License.
                         <groupId>com.github.eirslett</groupId>
                         <artifactId>frontend-maven-plugin</artifactId>
                         <version>${frontend-maven-plugin.version}</version>
+                        <configuration>
+                            <skip>${build.ui.skip}</skip>
+                        </configuration>
                         <executions>
                             <execution>
                                 <id>install node and npm</id>
diff --git a/pom.xml b/pom.xml
index 7862f794..bdf9f533 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,6 +23,7 @@ under the License.
     <modelVersion>4.0.0</modelVersion>
 
     <modules>
+        <module>paimon-web-dist</module>
         <module>paimon-web-ui</module>
         <module>paimon-web-server</module>
         <module>paimon-web-common</module>

Reply via email to