spring启动瘦jar,带有自定义父pom

lskq00tm  于 2021-07-06  发布在  Java
关注(0)|答案(0)|浏览(327)

我一直在尝试使用springboot瘦jar,在本地它运行得非常好,jar的大小非常小,但是当我将服务jar部署到远程服务器时,它不起作用。我在一篇文章中读到,如果你想让它工作,那么pom必须继承spring启动父,我使用自定义父pom,在远程服务器上它说pom(父pom)没有找到。瘦jar和maven引导配置如下

<plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.8.0</version>
            <configuration>
                <release>11</release>
            </configuration>
        </plugin>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
            <version>${spring-boot.version}</version>
            <configuration>
                <executable>true</executable>
            </configuration>
            <dependencies>
                <dependency>
                    <groupId>org.springframework.boot.experimental</groupId>
                    <artifactId>spring-boot-thin-layout</artifactId>
                    <version>1.0.25.RELEASE</version>
                </dependency>
            </dependencies>
        </plugin>

此pom继承父对象,如下所示

<parent>
    <artifactId>delivery-drivers</artifactId>
    <groupId>com.delivery</groupId>
    <version>1.0-SNAPSHOT</version>
</parent>
<modelVersion>4.0.0</modelVersion>

<artifactId>drivers-service</artifactId>

父级继承自spring启动父级,如下所示

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.3.1.RELEASE</version>
    <relativePath/> <!-- lookup parent from repository -->
</parent>

<groupId>com.delivery</groupId>
<artifactId>delivery-drivers</artifactId>
<packaging>pom</packaging>
<version>1.0-SNAPSHOT</version>
<modules>
    <module>drivers-api</module>
    <module>drivers-service</module>
</modules>

以下是服务器错误

[FATAL] Non-resolvable parent POM for com.delivery:drivers-service:[unknown-version]: Could not find artifact com.delivery:delivery-drivers:pom:1.0-SNAPSHOT in spring-snapshots (https://repo.spring.io/libs-snapshot) @ line 5, column 13

对于项目com。farsh:drivers-service:[未知版本]
有什么建议可以解决这个问题吗?

暂无答案!

目前还没有任何答案,快来回答吧!

相关问题