Search code examples
mavenmaven-2maven-3maven-plugin

replace version in maven


I have this piece of code in my pom.xml:

<build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-assembly-plugin</artifactId>
                    <configuration>
                        <descriptors>
                            <descriptor>assembly.xml</descriptor>
                        </descriptors>
                        <appendAssemblyId>false</appendAssemblyId>
                        <finalName>bonanza-{version}</finalName>
                    </configuration>
                    <executions>
                        <execution>
                            <id>make-assembly</id>
                            <phase>package</phase>
                            <goals>
                                <goal>single</goal>
                            </goals>
                        </execution>
                    </executions>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

but {version} is not replaced for the version of the project

 <groupId>com.bonanza</groupId>
    <artifactId>bonanza-lines</artifactId>
    <version>2.0.0</version>

Solution

  • I think it should be ${project.version}