The new Java project studies online notes -day20 (XI)

4.2.3 write Pom.xml
this example will xc-govern-center project to use Jenkins to build.
In xc-govern-center project root write pom_docker_registry.xml This file adds docker-maven-plugin plugin compared to the original project pom.xml, whose role is to build docker Mirror Mirror and pushed Docker private warehouse (192.168.101.64 : 5000).
[mw_shl_code = AppleScript, to true] <Project xmlns = "<XML Version =" 1.0 "encoding =" UTF-. 8 "??> http://maven.apache.org/POM/4.0.0 " xmlns: the xsi = " http://www.w3.org/2001/XMLSchema-instance "
xsi: schemaLocation =" http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven- 4.0.0.xsd "> ;
<parent>
<the artifactId> Framework-parent-XC </ the artifactId>
<the groupId> com.xuecheng </ the groupId>
<Version> 1.0-the SNAPSHOT <
<relativePath>../xc‐framework‐parent/pom.xml</relativePath>
[/mw_shl_code]
[mw_shl_code=applescript,true] </parent>
<modelVersion>4.0.0</modelVersion>
<artifactId>xc‐govern‐center</artifactId>
<version>1.0‐SNAPSHOT</version>
<dependencies>
<!‐‐ 导入Eureka服务的依赖 ‐‐>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring‐cloud‐starter‐netflix‐eureka‐server</artifactId>
</dependency>
</dependencies>
<build>
<finalName>${project.artifactId}‐${project.version}</finalName>
<plugins>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring‐boot‐maven‐plugin</artifactId>
</ plugin>
<plugin>
<the groupId> com.spotify </ the groupId>
<the artifactId> Docker-Maven-plugin </ the artifactId>
<Version> 1.0.0 </ Version>
<-! Docker mirroring configuration information - ->
<the Configuration>
<-! image name, project name used here ->
<imageName> $ {project.artifactId} - $ {project.version} </ imageName>
<-! Dockerfile file directory ->
<dockerDirectory> $ project.basedir} {/ the src / main / Resources </ dockerDirectory>
<-! the TAG, using this construction version number ->
<imageTags>
<imageTag> project.version $ {} </ imageTag>
< / imageTags>
<registryUrl> 192.168.101.64:5000 </ registryUrl>
<pushImage> to true </ pushImage>
<imageName> 192.168.101.64:5000 / project.artifactId} {$: $ {project.version} </ imageName>
<- Construction mirroring configuration information ->!
<resources>
<resource>
<targetPath>/</targetPath>
<directory>${project.build.directory}</directory>
<include>${project.artifactId}‐${project.version}.jar</include>
</resource>
</resources>
</configuration>
</plugin>
</plugins>
</build> </project>
[/mw_shl_code]

Guess you like

Origin blog.51cto.com/13517854/2433726