Method packaged idea java

Method 1: In the inside with maven pom.xml packaged configuration

<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>terminal marked mvn package namedthen the
</ plugins>





 

 

Open the Run command in cmd command inside:

java -server -Xms20M -Xmx50M -jar Jar packet address (default target directory scheme below)

 

 

 

 

Method 2, packaged with the idea, File-> Project Stricture Include in project builder remember deduction option, otherwise packaged into nothing

 

 

 

Guess you like

Origin www.cnblogs.com/zhian/p/11502263.html