fix: stabilize Maven settings for Spire build

This commit is contained in:
2026-03-02 00:03:33 +08:00
parent 19d7f921be
commit 34e0b42c2f
2 changed files with 25 additions and 13 deletions

View File

@@ -75,7 +75,7 @@ RUN mvn install:install-file \
-DartifactId=aspose-cells \
-Dversion=8.5.2 \
-Dpackaging=jar \
-B -s /root/.m2/settings.xml
-B -gs /root/.m2/settings.xml -s /root/.m2/settings.xml
RUN mvn install:install-file \
-Dfile=/tmp/local-jars/aspose-words-15.8.0-jdk16.jar \
@@ -83,7 +83,7 @@ RUN mvn install:install-file \
-DartifactId=aspose-words \
-Dversion=15.8.0 \
-Dpackaging=jar \
-B -s /root/.m2/settings.xml
-B -gs /root/.m2/settings.xml -s /root/.m2/settings.xml
RUN mvn install:install-file \
-Dfile=/tmp/local-jars/jai_codec-1.1.3.jar \
@@ -91,7 +91,7 @@ RUN mvn install:install-file \
-DartifactId=jai_codec \
-Dversion=1.1.3 \
-Dpackaging=jar \
-B -s /root/.m2/settings.xml
-B -gs /root/.m2/settings.xml -s /root/.m2/settings.xml
RUN mvn install:install-file \
-Dfile=/tmp/local-jars/jai_core.jar \
@@ -99,7 +99,7 @@ RUN mvn install:install-file \
-DartifactId=jai_core \
-Dversion=1.0.0-SNAPSHOT \
-Dpackaging=jar \
-B -s /root/.m2/settings.xml
-B -gs /root/.m2/settings.xml -s /root/.m2/settings.xml
RUN mvn install:install-file \
-Dfile=/tmp/local-jars/jce-0.0.1.jar \
@@ -107,7 +107,7 @@ RUN mvn install:install-file \
-DartifactId=jce \
-Dversion=0.0.1 \
-Dpackaging=jar \
-B -s /root/.m2/settings.xml
-B -gs /root/.m2/settings.xml -s /root/.m2/settings.xml
RUN mvn install:install-file \
-Dfile=/tmp/local-jars/agent-1.0.0.jar \
@@ -115,7 +115,7 @@ RUN mvn install:install-file \
-DartifactId=scofd \
-Dversion=1.0.1 \
-Dpackaging=jar \
-B -s /root/.m2/settings.xml
-B -gs /root/.m2/settings.xml -s /root/.m2/settings.xml
# 安装twain4java JAR用于扫描仪功能
RUN mvn install:install-file \
@@ -124,7 +124,7 @@ RUN mvn install:install-file \
-DartifactId=twain4java \
-Dversion=0.3.3-all \
-Dpackaging=jar \
-B -s /root/.m2/settings.xml
-B -gs /root/.m2/settings.xml -s /root/.m2/settings.xml
# 确保Maven仓库权限正确
RUN chown -R root:root /root/.m2 && \
@@ -139,12 +139,12 @@ RUN echo "=== 验证Maven环境 ===" && \
echo "=== 验证本地JAR文件 ===" && \
ls -la /tmp/local-jars/ && \
echo "=== 下载依赖(不编译) ===" && \
mvn dependency:go-offline -B -s /root/.m2/settings.xml -e || \
mvn dependency:resolve -B -s /root/.m2/settings.xml -e
mvn dependency:go-offline -B -gs /root/.m2/settings.xml -s /root/.m2/settings.xml -e || \
mvn dependency:resolve -B -gs /root/.m2/settings.xml -s /root/.m2/settings.xml -e
# 构建应用(移除离线模式,允许下载依赖)
RUN echo "=== 开始构建应用 ===" && \
mvn clean package -DskipTests -B -s /root/.m2/settings.xml -e \
mvn clean package -DskipTests -B -gs /root/.m2/settings.xml -s /root/.m2/settings.xml -e \
-Dmaven.test.skip=true \
-Dmaven.compiler.optimize=true \
&& \

View File

@@ -4,8 +4,8 @@
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<!-- 本地仓库位置 -->
<localRepository>/root/.m2/repository</localRepository>
<!-- 本地仓库位置(容器中 user.home=/root本地开发 user.home 为当前用户目录) -->
<localRepository>${user.home}/.m2/repository</localRepository>
<!-- 代理配置 -->
<proxies>
@@ -144,6 +144,18 @@
<enabled>true</enabled>
</snapshots>
</repository>
<!-- e-iceblue Spire 仓库(用于 spire.pdf.free -->
<repository>
<id>com.e-iceblue</id>
<url>https://repo.e-iceblue.cn/repository/maven-public/</url>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
<!-- JBossearlyaccess仓库 -->
<repository>
@@ -192,4 +204,4 @@
<activeProfiles>
<activeProfile>default</activeProfile>
</activeProfiles>
</settings>
</settings>