2

I'm trying to integrate maven in a legacy build setup. The artifactId and version is defined in an external file build.properties used by the legacy setup

project.name = "foobar"
project.version = "1.0"

Basically what I want to do is to define my Maven artifactId and version based on the property variables

<artifactId>${project.name}</artifactId>
<version>${project.version}</version>

How do I accomplish this in Maven ?

Tomas Karlsson
  • 705
  • 1
  • 6
  • 17
  • That will simply not work and it does not really makes sense...simply put it into the pom file where it belongs... – khmarbaise Feb 12 '17 at 18:03
  • For this use-case it does. Putting it in the pom would mean that the artifactid and version number would live at two places in the pom and in the property file. In this case Maven doesn't manage the build, it only uses a jar artifact from an Ant task. The reason to integrate Maven is to ease the use and deployment of legacy libraries in Maven based projects. Going all Maven is not an option. – Tomas Karlsson Feb 13 '17 at 13:50
  • Maybe this will help https://stackoverflow.com/questions/849389/how-to-read-an-external-properties-file-in-maven – mad_fox Dec 14 '17 at 01:56

0 Answers0