简体   繁体   English

如何通过Maven部署spring-boot构建的jar?

[英]How to deploy a jar built by spring-boot through maven?

I use mvn deploy command to deploy my jar file to nexus server and it works fine for regular jar. 我使用mvn deploy命令将我的jar文件部署到nexus服务器,并且对于常规jar来说运行良好。 But it doesn't work if the jar is packaged by spring-boot-plugin . 但是,如果jar是通过spring-boot-plugin打包的,则无法正常工作。 The header of the jar file is a linux system service script which will be rejected by nexus. jar文件的头是一个linux系统服务脚本,该脚本将被nexus拒绝。

Below is my spring-boot plugin settings: 以下是我的spring-boot插件设置:

<plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <version>2.0.2.RELEASE</version>
                <configuration>
                    <executable>true</executable>
                </configuration>
                <executions>
                    <execution>
                        <goals>
                            <goal>repackage</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>

How can I make nexus accepts spring-boot executable jar file? 如何使nexus接受spring-boot可执行jar文件?

Disable strict content type validation in your nexus server and you should be able to upload your jar. 在您的nexus服务器中禁用严格的内容类型验证,您应该可以上传jar。 It can be found as below, 可以发现如下

在此处输入图片说明

In administration, go to repository settings and disable this option. 在管理中,转到存储库设置并禁用此选项。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM