zoukankan      html  css  js  c++  java
  • spring boot

     项目创建

    替换https://start.spring.io/

    https://start.aliyun.com/

    工具

    热重启

    参考

    docker打包

    pom.xml

                <plugin>
                    <groupId>org.springframework.boot</groupId>
                    <artifactId>spring-boot-maven-plugin</artifactId>
                </plugin>
                <!-- Docker maven plugin -->
                <!--docker的操作-->
                <plugin>
                    <groupId>com.spotify</groupId>
                    <artifactId>docker-maven-plugin</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <imageName>${docker.image.prefix}/${project.artifactId}</imageName>
                        <dockerDirectory>src/main/docker</dockerDirectory>
                        <resources>
                            <resource>
                                <targetPath>/</targetPath>
                                <directory>${project.build.directory}</directory>
                                <include>${project.build.finalName}.jar</include>
                            </resource>
                        </resources>
    
                        <!--docker主机ip-->
    <!--                    <dockerHost>http://192.168.10.119:8087</dockerHost>-->
                        <!--docker镜像名-->
                        <imageName>yiui/${project.artifactId}</imageName>
                        <!--docker镜像tags-->
                        <imageTags>
                            <imageTag>${project.version}</imageTag>
                        </imageTags>
                        <!--如果你想强制docker在每次新的构建上覆盖镜像tags 就加forceTags-->
                        <forceTags>true</forceTags>
    
                    </configuration>
                </plugin>
                <!--docker需要的jar的复制操作-->
                <plugin>
                    <artifactId>maven-antrun-plugin</artifactId>
                    <version>1.8</version>
                    <executions>
                        <execution>
                            <phase>package</phase>
                            <configuration>
                                <tasks>
                                    <copy todir="src/main/docker"
                                          file="target/${project.artifactId}-${project.version}.${project.packaging}"></copy>
                                </tasks>
                            </configuration>
                            <goals>
                                <goal>run</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
    View Code

    执行命令 

    mvn clean package dockerfile:build

    。。。

  • 相关阅读:
    How to Integrate JCaptcha in Spring Security
    精简的webservice
    linux时间与Windows时间不一致的解决
    java泛型
    spring全局变量引起的并发问题
    ByteBuffer常用方法详解
    cindy
    NIO之Buffer的clear()、rewind()、flip()方法的区别
    Java NIO(New I/O)的三个属性position、limit、capacity
    技术选型
  • 原文地址:https://www.cnblogs.com/huay/p/13656235.html
Copyright © 2011-2022 走看看