Maven - how to set parent version in submodule

I want to install version for all modules in the main module.

The main module:

<groupId>com.myproject</groupId>
<artifactId>myproject-main-module</artifactId>
<version>${myproject.version}</version>
<packaging>pom</packaging>

<properties>
   <myproject.version>3.1.0-SNAPSHOT</myproject.version>
   <myproject.parent.version>1.1</myproject.parent.version>
</properties>

      

Submodule:

<groupId>com.myproject</groupId>
<artifactId>myproject-submodule</artifactId>
<packaging>pom</packaging>

<parent>
   <groupId>com.myproject</groupId>
   <artifactId>myproject-main-module</artifactId>
   <version>${myproject.version}</version>
</parent>

      

Why is $ {myproject.version} not considered a submodule and what should I do if I want to install the version only once for all modules.

+3
maven


source to share


No one has answered this question yet

Check out similar questions:

1011
How do I add local jar files to a Maven project?
866
How to solve "Executing plugins not covered by lifecycle config" for Spring Data Maven Builds
768
What is Maven Snapshot and why do we need it?
670
How do I tell Maven to use the latest dependency?
665
Force maven update
663
Differences Between Dependencies and Management in Maven
646
Working with "Xerces hell" in Java / Maven?
191
Updating module version numbers in a multi-module Maven project
93
Skip submodule during Maven build
0
Maven Submodule Dependencies



All Articles
Loading...
X
Show
Funny
Dev
Pics