今日份学习:部署?

笔记

Springboot 修改配置文件

Externalized Configuration

Maven Lifecycle

生命周期

使用 Maven exec plugin

pom.xml加入:

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>exec-maven-plugin</artifactId>
    <version>1.6.0</version>
    <configuration>
        <executable>java</executable>    //要运行什么程序
        <arguments>
            <argument>-classpath</argument>
            <!-- automatically creates the classpath using all project dependencies,
                 also adding the project build directory -->
            <classpath/>
            <argument>com.example.Main</argument>    //运行这个程序的时候用什么参数
        </arguments>
    </configuration>
</plugin>

运行:

# mvn exec:exec

参考于:MojoHaus

emmm....感觉不太方便。

jar包

jar包:编译后的代码和资源打包

# mvn package

mvn xxx -DskipTests 忽略测试

# java -jar xxx.jar/xxx.zip

本质其实还是 #java -classpath com.example.Main

Docker

emmm...好像差不多

猜你喜欢

转载自www.cnblogs.com/pipemm/p/12308373.html