zoukankan      html  css  js  c++  java
  • idea java 打包的方法

    方法1: 在pom.xml 里面加上maven打包的配置

    <plugin>
    <groupId>org.springframework.cloud</groupId>
    <artifactId>spring-cloud-contract-maven-plugin</artifactId>
    <version>2.0.0.RELEASE</version>
    <!-- Don't forget about this value !! -->
    <extensions>true</extensions>
    <configuration>
    <!-- Provide the base class for your auto-generated tests -->
    <baseClassForTests>com.springboot.cloud.demos.producer.MvcMockTest</baseClassForTests>
    </configuration>
    </plugin>
    <!--docker镜像build插件-->
    <plugin>
    <groupId>com.spotify</groupId>
    <artifactId>docker-maven-plugin</artifactId>
    <version>1.0.0</version>
    <configuration>
    <!-- 注意imageName一定要是符合正则[a-z0-9-_.]的,否则构建不会成功 -->
    <imageName>cike/${project.artifactId}</imageName>
    <dockerDirectory>${project.basedir}/src/main/docker</dockerDirectory>
    <rm>true</rm>
    <resources>
    <resource>
    <targetPath>/</targetPath>
    <directory>${project.build.directory}</directory>
    <include>${project.build.finalName}.jar</include>
    </resource>
    </resources>
    </configuration>
    </plugin>
    </plugins>


    然后在
    terminal 打上命名 mvn package

    在cmd命令 里面打开运行 , 命令是:

    java -server -Xms20M -Xmx50M -jar  Jar包地址(默认在方案下面的target目录下)

    方法2,用idea进行打包, File->Project Stricture    Include in project builder 记得扣选,不然打包进去没有东西

  • 相关阅读:
    关于shell输出的一些问题
    python一些问题
    excel
    梁先生家书摘录
    使用conda安装requirement.txt指定的依赖包
    Matplotlib 的默认颜色 以及 使用调色盘调整颜色
    各种 Shell 的使用
    将实验数据保存到txt文件中
    机器学习-学习资源
    Gvim 的使用
  • 原文地址:https://www.cnblogs.com/zhian/p/11502263.html
Copyright © 2011-2022 走看看