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 记得扣选,不然打包进去没有东西

  • 相关阅读:
    jquery 选择器
    LeetCode_217. Contains Duplicate
    LeetCode_206. Reverse Linked List
    LeetCode_205. Isomorphic Strings
    LeetCode_204. Count Primes
    LeetCode_203. Remove Linked List Elements
    LeetCode_202. Happy Number
    LeetCode_198. House Robber
    LeetCode_191. Number of 1 Bits
    LeetCode_190. Reverse Bits
  • 原文地址:https://www.cnblogs.com/zhian/p/11502263.html
Copyright © 2011-2022 走看看