Skip to content

Commit e10f734

Browse files
committed
fix: fixed dependencies and docker build
1 parent dff9f54 commit e10f734

File tree

22 files changed

+66
-139
lines changed

22 files changed

+66
-139
lines changed

deploy/docker/Dockerfile

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,11 +37,9 @@ RUN apt-get update && apt-get install -y --no-install-recommends gosu \
3737
COPY --chown=lowcoder:lowcoder --from=build-api-service /lowcoder/api-service /lowcoder/api-service
3838

3939
# Copy lowcoder api service app, dependencies and libs
40-
COPY --chown=lowcoder:lowcoder --from=build-api-service /lowcoder-server/distribution/target/lowcoder-api-service-bin/app /lowcoder/api-service/app
41-
COPY --chown=lowcoder:lowcoder --from=build-api-service /lowcoder-server/distribution/target/lowcoder-api-service-bin/dependencies /lowcoder/api-service/dependencies
40+
COPY --chown=lowcoder:lowcoder --from=build-api-service /lowcoder-server/distribution/target/lowcoder-api-service-bin/lowcoder-api-service.jar /lowcoder/api-service/lowcoder-api-service.jar
4241
COPY --chown=lowcoder:lowcoder --from=build-api-service /lowcoder-server/distribution/target/lowcoder-api-service-bin/libs /lowcoder/api-service/libs
4342
COPY --chown=lowcoder:lowcoder --from=build-api-service /lowcoder-server/distribution/target/lowcoder-api-service-bin/plugins /lowcoder/api-service/plugins
44-
COPY --chown=lowcoder:lowcoder --from=build-api-service /lowcoder-server/distribution/target/lowcoder-api-service-bin/set-classpath.sh /lowcoder/api-service/set-classpath.sh
4543

4644
EXPOSE 8080
4745
CMD [ "/bin/bash" , "/lowcoder/api-service/entrypoint.sh" ]

deploy/docker/api-service/entrypoint.sh

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ echo "Initializing api-service..."
1212
if [ -z $JAVA_HOME ]; then
1313
JAVA_HOME=`dirname $(dirname $(readlink -f $(which javac)))`
1414
fi;
15-
APP_JAR="${APP_JAR:=/lowcoder/api-service/server.jar}"
15+
APP_JAR="${APP_JAR:=/lowcoder/api-service/lowcoder-api-service.jar}"
1616
JAVA_OPTS="${JAVA_OPTS:=}"
1717
CUSTOM_APP_PROPERTIES="${APP_PROPERTIES}"
1818
CONTEXT_PATH=${CONTEXT_PATH:=/}
@@ -27,7 +27,6 @@ ${JAVA_HOME}/bin/java -version
2727
echo
2828

2929
cd /lowcoder/api-service
30-
source set-classpath.sh
3130

3231
exec gosu ${USER_ID}:${GROUP_ID} ${JAVA_HOME}/bin/java \
3332
-Djava.util.prefs.userRoot=/tmp \
@@ -36,7 +35,6 @@ exec gosu ${USER_ID}:${GROUP_ID} ${JAVA_HOME}/bin/java \
3635
-Dlog4j2.formatMsgNoLookups=true \
3736
-Dspring.config.location="file:///lowcoder/api-service/config/application.yaml" \
3837
--add-opens java.base/java.nio=ALL-UNNAMED \
39-
-cp "${LOWCODER_CLASSPATH:=.}" \
4038
${JAVA_OPTS} \
41-
org.lowcoder.api.ServerApplication --spring.webflux.base-path=${CONTEXT_PATH} ${CUSTOM_APP_PROPERTIES}
39+
-jar ${APP_JAR} --spring.webflux.base-path=${CONTEXT_PATH} ${CUSTOM_APP_PROPERTIES}
4240

server/api-service/distribution/pom.xml

Lines changed: 0 additions & 84 deletions
This file was deleted.

server/api-service/distribution/src/assembly/set-classpath.sh

Lines changed: 0 additions & 11 deletions
This file was deleted.

server/api-service/lowcoder-plugins/clickHousePlugin/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
</parent>
1010

1111
<modelVersion>4.0.0</modelVersion>
12+
<groupId>org.lowcoder.plugins</groupId>
1213
<artifactId>clickHousePlugin</artifactId>
1314
<packaging>jar</packaging>
1415

server/api-service/lowcoder-plugins/elasticSearchPlugin/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
</parent>
1010

1111
<modelVersion>4.0.0</modelVersion>
12+
<groupId>org.lowcoder.plugins</groupId>
1213
<artifactId>elasticSearchPlugin</artifactId>
1314

1415
<name>elasticSearchPlugin</name>

server/api-service/lowcoder-plugins/googleSheetsPlugin/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
</parent>
1010

1111
<modelVersion>4.0.0</modelVersion>
12+
<groupId>org.lowcoder.plugins</groupId>
1213
<artifactId>googleSheetsPlugin</artifactId>
1314

1415
<name>googleSheetsPlugin</name>

server/api-service/lowcoder-plugins/lowcoderApiPlugin/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

12+
<groupId>org.lowcoder.plugins</groupId>
1213
<artifactId>lowcoderApiPlugin</artifactId>
1314

1415
<properties>

server/api-service/lowcoder-plugins/mongoPlugin/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
</parent>
1010

1111
<modelVersion>4.0.0</modelVersion>
12+
<groupId>org.lowcoder.plugins</groupId>
1213
<artifactId>mongoPlugin</artifactId>
1314

1415
<name>mongoPlugin</name>

server/api-service/lowcoder-plugins/mssqlPlugin/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
</parent>
1010

1111
<modelVersion>4.0.0</modelVersion>
12+
<groupId>org.lowcoder.plugins</groupId>
1213
<artifactId>mssqlPlugin</artifactId>
1314

1415
<name>mssqlPlugin</name>

server/api-service/lowcoder-plugins/mysqlPlugin/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
</parent>
1010

1111
<modelVersion>4.0.0</modelVersion>
12+
<groupId>org.lowcoder.plugins</groupId>
1213
<artifactId>mysqlPlugin</artifactId>
1314

1415
<name>mysqlPlugin</name>

server/api-service/lowcoder-plugins/oraclePlugin/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
</parent>
1010
<modelVersion>4.0.0</modelVersion>
1111

12+
<groupId>org.lowcoder.plugins</groupId>
1213
<artifactId>oraclePlugin</artifactId>
1314

1415

server/api-service/lowcoder-plugins/postgresPlugin/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
</parent>
1111

1212
<modelVersion>4.0.0</modelVersion>
13+
<groupId>org.lowcoder.plugins</groupId>
1314
<artifactId>postgresPlugin</artifactId>
1415

1516
<name>postgresPlugin</name>

server/api-service/lowcoder-plugins/redisPlugin/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
</parent>
1010

1111
<modelVersion>4.0.0</modelVersion>
12+
<groupId>org.lowcoder.plugins</groupId>
1213
<artifactId>redisPlugin</artifactId>
1314

1415
<name>redisPlugin</name>

server/api-service/lowcoder-plugins/restApiPlugin/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
</parent>
1010

1111
<modelVersion>4.0.0</modelVersion>
12+
<groupId>org.lowcoder.plugins</groupId>
1213
<artifactId>restApiPlugin</artifactId>
1314

1415
<name>restApiPlugin</name>

server/api-service/lowcoder-plugins/smtpPlugin/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
</parent>
1010

1111
<modelVersion>4.0.0</modelVersion>
12+
<groupId>org.lowcoder.plugins</groupId>
1213
<artifactId>smtpPlugin</artifactId>
1314

1415
<name>smtpPlugin</name>

server/api-service/lowcoder-plugins/snowflakePlugin/pom.xml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
<version>${revision}</version>
1010
</parent>
1111

12+
<groupId>org.lowcoder.plugins</groupId>
1213
<artifactId>snowflakePlugin</artifactId>
1314

1415
<properties>

server/api-service/lowcoder-server/pom.xml

Lines changed: 44 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
<properties>
1818
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
1919
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
20+
<assembly.lib.directory>${project.build.directory}/app-libs</assembly.lib.directory>
2021

2122
<skipTests>false</skipTests>
2223
<skipUnitTests>${skipTests}</skipUnitTests>
@@ -44,6 +45,11 @@
4445
<groupId>org.lowcoder</groupId>
4546
<artifactId>lowcoder-domain</artifactId>
4647
</dependency>
48+
<dependency>
49+
<groupId>org.lowcoder</groupId>
50+
<artifactId>sqlBasedPlugin</artifactId>
51+
<version>${revision}</version>
52+
</dependency>
4753
<dependency>
4854
<groupId>org.lowcoder.plugin</groupId>
4955
<artifactId>lowcoder-plugin-api</artifactId>
@@ -249,14 +255,34 @@
249255

250256
<build>
251257
<plugins>
258+
<plugin>
259+
<groupId>org.apache.maven.plugins</groupId>
260+
<artifactId>maven-dependency-plugin</artifactId>
261+
<executions>
262+
<execution>
263+
<id>copy-dependencies</id>
264+
<phase>package</phase>
265+
<goals>
266+
<goal>copy-dependencies</goal>
267+
</goals>
268+
<configuration>
269+
<outputDirectory>${assembly.lib.directory}</outputDirectory>
270+
<includeScope>runtime</includeScope>
271+
</configuration>
272+
</execution>
273+
</executions>
274+
</plugin>
252275
<plugin>
253276
<groupId>org.apache.maven.plugins</groupId>
254277
<artifactId>maven-jar-plugin</artifactId>
255278
<version>3.3.0</version>
256279
<configuration>
280+
<finalName>lowcoder-api-service</finalName>
257281
<archive>
258282
<manifest>
259283
<mainClass>org.lowcoder.api.ServerApplication</mainClass>
284+
<classpathPrefix>libs/</classpathPrefix>
285+
<addClasspath>true</addClasspath>
260286
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
261287
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
262288
<addBuildEnvironmentEntries>true</addBuildEnvironmentEntries>
@@ -290,7 +316,6 @@
290316
<keypass>${keystore.key.password}</keypass>
291317
</configuration>
292318
</plugin>
293-
294319
<plugin>
295320
<groupId>org.apache.maven.plugins</groupId>
296321
<artifactId>maven-surefire-plugin</artifactId>
@@ -357,6 +382,24 @@
357382
</execution>
358383
</executions>
359384
</plugin>
385+
<plugin>
386+
<artifactId>maven-assembly-plugin</artifactId>
387+
<executions>
388+
<execution>
389+
<id>distro-assembly</id>
390+
<phase>package</phase>
391+
<goals>
392+
<goal>single</goal>
393+
</goals>
394+
<configuration>
395+
<attach>false</attach>
396+
<descriptors>
397+
<descriptor>src/assembly/bin.xml</descriptor>
398+
</descriptors>
399+
</configuration>
400+
</execution>
401+
</executions>
402+
</plugin>
360403
</plugins>
361404
</build>
362405

server/api-service/distribution/src/assembly/bin.xml renamed to server/api-service/lowcoder-server/src/assembly/bin.xml

Lines changed: 5 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -7,19 +7,10 @@
77
</formats>
88
<includeBaseDirectory>false</includeBaseDirectory>
99

10-
<files>
11-
<file>
12-
<source>src/assembly/set-classpath.sh</source>
13-
<outputDirectory></outputDirectory>
14-
</file>
15-
</files>
1610
<fileSets>
1711
<fileSet>
1812
<directory>${assembly.lib.directory}</directory>
19-
<outputDirectory>dependencies</outputDirectory>
20-
<excludes>
21-
<exclude>${project.groupId}:*</exclude>
22-
</excludes>
13+
<outputDirectory>libs</outputDirectory>
2314
</fileSet>
2415
</fileSets>
2516

@@ -31,43 +22,24 @@
3122
<include>org.lowcoder:lowcoder-server</include>
3223
</includes>
3324
<binaries>
34-
<outputDirectory>app</outputDirectory>
25+
<outputDirectory>.</outputDirectory>
3526
<includeDependencies>false</includeDependencies>
3627
<unpack>false</unpack>
3728
</binaries>
3829
</moduleSet>
3930

40-
<!-- Lowcoder API server dependencies -->
41-
<moduleSet>
42-
<useAllReactorProjects>true</useAllReactorProjects>
43-
<includes>
44-
<include>org.lowcoder:lowcoder-domain</include>
45-
<include>org.lowcoder:lowcoder-infra</include>
46-
<include>org.lowcoder:lowcoder-sdk</include>
47-
<include>org.lowcoder:sqlBasedPlugin</include>
48-
</includes>
49-
<binaries>
50-
<outputDirectory>libs</outputDirectory>
51-
<includeDependencies>false</includeDependencies>
52-
<unpack>false</unpack>
53-
</binaries>
54-
</moduleSet>
55-
56-
<!-- Lowcoder plugins -->
31+
<!-- Lowcoder plugins -->
5732
<moduleSet>
5833
<useAllReactorProjects>true</useAllReactorProjects>
5934
<includeSubModules>true</includeSubModules>
6035
<includes>
61-
<include>org.lowcoder:*Plugin</include>
36+
<include>org.lowcoder.plugins:*Plugin</include>
6237
</includes>
63-
<excludes>
64-
<exclude>org.lowcoder:sqlBasedPlugin</exclude>
65-
</excludes>
6638
<binaries>
6739
<outputDirectory>plugins</outputDirectory>
6840
<includeDependencies>false</includeDependencies>
6941
<unpack>false</unpack>
7042
</binaries>
71-
</moduleSet>
43+
</moduleSet>
7244
</moduleSets>
7345
</assembly>

0 commit comments

Comments
 (0)