Hi, in our company we use some elaborate way how we stack patched on top of our product. The consequence of that is we use expressions for defining the version of a pom in the parent definition of our submodules. Example:
Root pom: <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <parent> <groupId>com.group</groupId> <artifactId>product</artifactId> <version>1.1.1</version> </parent> <modelVersion>4.0.0</modelVersion> <groupId>com.group.patch</groupId> <artifactId>Group-patch</artifactId> <version>${patch.version}</version> <packaging>pom</packaging> <properties> <customer>customername</customer> <tag.version>1.1.1</tag.version> <delivery.version>1</delivery.version> <patch.version>${tag.version}-${customer}-${delivery.version}</patch.version> </properties> <modules> <module>patch-distribution</module> </modules> </project> module patch-distribution pom: <project xmlns="http://maven.apache.org/POM/4.0.0” xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance” xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> <parent> <groupId>com.group.patch</groupId> <artifactId>Group-patch</artifactId> <version>${patch.version}</version> <relativePath>..</relativePath> </parent> <modelVersion>4.0.0</modelVersion> <artifactId>patch-distribution</artifactId> <packaging>pom</packaging> </project> We use this pattern for the submodules everywhere. The benefit is that we only need to define versions in the root pom and have no amount of duplicated information in all poms. The build works perfectly this way. There are warnings about using an expression inside the parent.version, but it does work. Now, the catch is when you deploy these. Lets say for example, in a different project you reference patch-distribution-1.1.1-customername-1.jar (thats the complete name of the dependency). The jar and pom will be stored correctly under that name, but the contents of the pom still contains the expression ${patch.version}, which now is unknown. You could add the definition in your own pom, but that is cumbersome. It would be neat, if in the process of deploying the pom to the repository, you could rewrite the pom and exchange the expression for its actual value. Now, any ideas how to do that, besides rewriting the complete deploy plugin? Thanks in advance. Christian
