mirror of
https://github.com/spring-projects/spring-petclinic.git
synced 2025-07-21 06:45:49 +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/*
|
||||
petclinic-application/target/*
|
||||
/petclinic-containers/src/main/resources/petclinic.jar
|
||||
petclinic-container/target/context/petclinic.jar
|
||||
.settings/*
|
||||
.classpath
|
||||
.editorconfig
|
||||
|
|
|
@ -206,5 +206,4 @@
|
|||
</plugin>
|
||||
</plugins>
|
||||
</build>
|
||||
|
||||
</project>
|
||||
|
|
|
@ -25,6 +25,29 @@
|
|||
</resource>
|
||||
</resources>
|
||||
<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>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-dependency-plugin</artifactId>
|
||||
|
@ -43,7 +66,7 @@
|
|||
<version>${project.version}</version>
|
||||
<type>jar</type>
|
||||
<overWrite>true</overWrite>
|
||||
<outputDirectory>${basedir}/src/main/resources</outputDirectory>
|
||||
<outputDirectory>${basedir}/target/context/</outputDirectory>
|
||||
<destFileName>petclinic.jar</destFileName>
|
||||
</artifactItem>
|
||||
</artifactItems>
|
||||
|
@ -64,7 +87,7 @@
|
|||
</goals>
|
||||
<configuration>
|
||||
<executable>docker</executable>
|
||||
<workingDirectory>${project.basedir}/src/main/resources</workingDirectory>
|
||||
<workingDirectory>${project.basedir}/target/context/</workingDirectory>
|
||||
<arguments>
|
||||
<argument>build</argument>
|
||||
<argument>.</argument>
|
||||
|
@ -80,3 +103,7 @@
|
|||
</profile>
|
||||
</profiles>
|
||||
</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 -->
|
||||
<deploy-plugin.version>2.8.1</deploy-plugin.version>
|
||||
<mojo-exec.version>1.6.0</mojo-exec.version>
|
||||
<resources-plugin.version>3.1.0</resources-plugin.version>
|
||||
</properties>
|
||||
|
||||
<repositories>
|
||||
|
|
Loading…
Reference in a new issue