Java 打包到部署子工程出错
1 打包jar
坑1:打包提示成功,但是文件没有内容
需要在 pom.xml添加以下内容:
<!-- 打包格式 -->
<packaging>jar</packaging>
<!-- 打包插件 -->
<build>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<executable>true</executable>
<layout>JAR</layout>
</configuration>
<executions>
<execution>
<goals>
<goal>repackage</goal>
</goals>
<configuration>
<attach>false</attach>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
</build>
坑2:单独打包module提示失败: “Failed to collect dependencies at org”
转载方法:https://zhuanlan.zhihu.com/p/556687317
新建了一个Maven工程,下面添加了多个Module,Module之间互相依赖。
使用maven install打包第一个Module,在第二个module的pom中添加对第一个module的引用
maven install打包第二个Module,报错:Failed to collect dependencies at ...
解决方案:在主工程中运行 maven install,而后再打包其它包即可
在主工程中运行 maven install,而后再打包其它包即可

2 cmd部署
eg cd C:\A-MySelf\WebSite\cloud-provider java -jar cloud-provider-0.0.1-SNAPSHOT.jar
3 怎么才能一直部署,这个方式cmd关闭后程序就关闭了?
浙公网安备 33010602011771号