tags:

views:

87

answers:

1

I have a parent project that defines a property, for example:

    <properties>
        <myproject-version>1.0</myproject-version>
    </properties>

In a 'child' project I use

<parent>
    <groupId>com.home</groupId>
    <artifactId>my-modules</artifactId>
    <version>${myproject-version}</version>
</parent>

Everything works nice, but when Maven installs jar in repository, it creates pom like

<parent>
    <groupId>com.home</groupId>
    <artifactId>my-modules</artifactId>
    <version>${myproject-version}</version>
</parent>

And I need that value of my-version to be replaced with 1.0

<parent>
    <groupId>com.home</groupId>
    <artifactId>my-modules</artifactId>
    <version>1.0</version>
</parent>

Is there any way to do that? I need 1.0 because of some compilation problems that occure when other projects use my project as dependency. (They look for a version ${myproject-version} instead of '1.0'

+1  A: 

Actually, I'm surprised to see this even working. A version must be specified in the parent tag (otherwise there is no way to know which version to pull from the repository) but that version should not be defined in terms of data defined in the parent pom, otherwise an obvious problem occurs: the parent pom would be needed to determine which parent pom is needed.

So I don't think there is any way to do what you are trying to do and, to be honest, I think its a bad idea.

Pascal Thivent