I have a java/hibernate/jpa/maven project that I am trying to convert so that it (the .jar file created from the project) is part of a Docker Image. I am also using the Spotify plugin.
Below, for the following Docker command
ADD <full_path_of_generated_file>.jar app.jar
The value full_path_of_generated_file is generated from the pom.xml file (on the Maven side). This information is needed in order for Docker to generate the image properly.
How can one get the name of the generated file over to the Dockerfile?
TIA
Plugin area of the Maven pom.xml file
<plugins>
<plugin>
<groupId>com.spotify</groupId>
<artifactId>docker-maven-plugin</artifactId>
<configuration>
<imageName>apx/${project.artifactId}</imageName>
<dockerDirectory>${project.basedir}/docker</dockerDirectory>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<!-- <version>2.6</version> -->
<executions>
<execution>
<id>analyze</id>
<phase>package</phase>
<configuration>
<failBuild>true</failBuild>
<ignoreDirect>false</ignoreDirect>
</configuration>
</execution>
</executions>
<configuration>
<finalName>${project.artifactId}</finalName>
<archive>
<manifest>
<mainClass>ccinfw.MainApplication</mainClass>
</manifest>
</archive>
</configuration>
</plugin>
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
</plugin>
</plugins>
[... snip ...]
<artifactId>ccinf</artifactId>
Below is a copy of the Dockerfile being used
FROM java:8
VOLUME /tmp
ADD <full_path_of_generated_file>.jar app.jar
RUN bash -c 'touch /app.jar'
EXPOSE 8080
ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
