title: What is the best practice to get the file name that was defined in the pom.xml, from within the docker file?
body: <p>I am creating a docker file for my Spring Boot application.</p>
  
  <p>Here is the file:</p>
  
  <pre><code>FROM openjdk:8-jdk-alpine
  COPY eureka/target/eureka-1.0.jar app.jar
  ENTRYPOINT ["java","-Djava.security.egd=file:/dev/./urandom","-jar","/app.jar"]
  </code></pre>
  
  <p>The name of the jar file (it is eureka-1.0.jar in this case) is defined in the pom.xml</p>
  
  <pre><code>&lt;artifactId&gt;eureka&lt;/artifactId&gt;
  &lt;version&gt;1.0&lt;/version&gt;
  &lt;packaging&gt;jar&lt;/packaging&gt;
  </code></pre>
  
  <p>My question is; when I change the file name in the pom, I am having to reflect the change to the docker file manually, which is ruining the automatic deployment process. </p>
  
  <p>What is the best practice to get the file name that was defined in the pom.xml, from within the docker file? </p>
  
  <p><em>(In case it matters for best practices: there are multiple docker files all similar to this one and they are used by a docker-compose.yml)</em></p>