mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-21 14:55:51 +00:00
resources plugin added and the target dir has been crated for building docker images
This commit is contained in:
parent
590d03d96b
commit
1bcd575553
6 changed files with 35 additions and 4 deletions
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,6 +1,6 @@
|
||||||
target/*
|
target/*
|
||||||
petclinic-application/target/*
|
petclinic-application/target/*
|
||||||
/petclinic-containers/src/main/resources/petclinic.jar
|
petclinic-container/target/context/petclinic.jar
|
||||||
.settings/*
|
.settings/*
|
||||||
.classpath
|
.classpath
|
||||||
.editorconfig
|
.editorconfig
|
||||||
|
|
|
@ -206,5 +206,4 @@
|
||||||
</plugin>
|
</plugin>
|
||||||
</plugins>
|
</plugins>
|
||||||
</build>
|
</build>
|
||||||
|
|
||||||
</project>
|
</project>
|
||||||
|
|
|
@ -25,6 +25,29 @@
|
||||||
</resource>
|
</resource>
|
||||||
</resources>
|
</resources>
|
||||||
<plugins>
|
<plugins>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-resources-plugin</artifactId>
|
||||||
|
<version>${resources-plugin.version}</version>
|
||||||
|
<executions>
|
||||||
|
<execution>
|
||||||
|
<id>copy-resources</id>
|
||||||
|
<!-- here the phase you need -->
|
||||||
|
<phase>validate</phase>
|
||||||
|
<goals>
|
||||||
|
<goal>copy-resources</goal>
|
||||||
|
</goals>
|
||||||
|
<configuration>
|
||||||
|
<outputDirectory>${basedir}/target/context/</outputDirectory>
|
||||||
|
<resources>
|
||||||
|
<resource>
|
||||||
|
<directory>${basedir}/src/main/resources</directory>
|
||||||
|
<filtering>true</filtering>
|
||||||
|
</resource>
|
||||||
|
</resources>
|
||||||
|
</configuration>
|
||||||
|
</execution>
|
||||||
|
</executions>
|
||||||
|
</plugin>
|
||||||
<plugin>
|
<plugin>
|
||||||
<groupId>org.apache.maven.plugins</groupId>
|
<groupId>org.apache.maven.plugins</groupId>
|
||||||
<artifactId>maven-dependency-plugin</artifactId>
|
<artifactId>maven-dependency-plugin</artifactId>
|
||||||
|
@ -43,7 +66,7 @@
|
||||||
<version>${project.version}</version>
|
<version>${project.version}</version>
|
||||||
<type>jar</type>
|
<type>jar</type>
|
||||||
<overWrite>true</overWrite>
|
<overWrite>true</overWrite>
|
||||||
<outputDirectory>${basedir}/src/main/resources</outputDirectory>
|
<outputDirectory>${basedir}/target/context/</outputDirectory>
|
||||||
<destFileName>petclinic.jar</destFileName>
|
<destFileName>petclinic.jar</destFileName>
|
||||||
</artifactItem>
|
</artifactItem>
|
||||||
</artifactItems>
|
</artifactItems>
|
||||||
|
@ -64,7 +87,7 @@
|
||||||
</goals>
|
</goals>
|
||||||
<configuration>
|
<configuration>
|
||||||
<executable>docker</executable>
|
<executable>docker</executable>
|
||||||
<workingDirectory>${project.basedir}/src/main/resources</workingDirectory>
|
<workingDirectory>${project.basedir}/target/context/</workingDirectory>
|
||||||
<arguments>
|
<arguments>
|
||||||
<argument>build</argument>
|
<argument>build</argument>
|
||||||
<argument>.</argument>
|
<argument>.</argument>
|
||||||
|
@ -80,3 +103,7 @@
|
||||||
</profile>
|
</profile>
|
||||||
</profiles>
|
</profiles>
|
||||||
</project>
|
</project>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
/target/context/{Dockerfile, jars, resurces}
|
||||||
|
-->
|
||||||
|
|
Binary file not shown.
4
petclinic-container/target/context/dockerfile
Normal file
4
petclinic-container/target/context/dockerfile
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
FROM java:8
|
||||||
|
EXPOSE 8080
|
||||||
|
COPY petclinic.jar /
|
||||||
|
CMD ["java", "-jar", "petclinic.jar"]
|
1
pom.xml
1
pom.xml
|
@ -45,6 +45,7 @@
|
||||||
<!-- Other properties -->
|
<!-- Other properties -->
|
||||||
<deploy-plugin.version>2.8.1</deploy-plugin.version>
|
<deploy-plugin.version>2.8.1</deploy-plugin.version>
|
||||||
<mojo-exec.version>1.6.0</mojo-exec.version>
|
<mojo-exec.version>1.6.0</mojo-exec.version>
|
||||||
|
<resources-plugin.version>3.1.0</resources-plugin.version>
|
||||||
</properties>
|
</properties>
|
||||||
|
|
||||||
<repositories>
|
<repositories>
|
||||||
|
|
Loading…
Reference in a new issue