'dependencies.dependency.version' is missing error, but version is managed in parent 'dependencies.dependency.version' is missing error, but version is managed in parent java java

'dependencies.dependency.version' is missing error, but version is managed in parent


A couple things I think you could try:

  1. Put the literal value of the version in the child pom

    <dependency>  <groupId>org.springframework</groupId>  <artifactId>spring-core</artifactId>  <version>3.2.3.RELEASE</version>  <scope>runtime</scope></dependency>
  2. Clear your .m2 cache normally located C:\Users\user.m2\repository. I would say I do this pretty frequently when I'm working in maven. Especially before committing so that I can be more confident CI will run. You don't have to nuke the folder every time, sometimes just your project packages and the .cache folder are enough.

  3. Add a relativePath tag to your parent pom declaration

    <parent>  <groupId>com.mycompany.app</groupId>  <artifactId>my-app</artifactId>  <version>1</version> <relativePath>../parent/pom.xml</relativePath></parent>

It looks like you have 8 total errors in your poms. I would try to get some basic compilation running before adding the parent pom and properties.


If anyone finds their way here with the same problem I was having, my problem was that I was missing the <dependencyManagement> tags around dependencies I had copied from the child pom.


Right, after a lot of hair tearing I have a compiling system.

Cleaning the .m2 cache was one thing that helped (thanks to Brian)

One of the mistakes I had made was to put 2 versions of each dependency in the parent pom dependencyManagement section - one with <scope>runtime</scope> and one without - this was to try and make eclipse happy (ie not show up rogue compile errors) as well as being able to run on the command line. This was just complicating matters, so I removed the runtime ones.

Explicitly setting the version of the parent seemed to work also (it's a shame that maven doesn't have more wide-ranging support for using properties like this!)

  <parent>    <groupId>com.sw.system4</groupId>    <artifactId>system4-parent</artifactId>    <version>0.0.1-SNAPSHOT</version>  </parent>

I was then getting weird 'failed to collect dependencies for' errors in the child module for all the dependencies, saying it couldn't locate the parent - even though it was set up the same as other modules which did compile.

I finally solved things by compiling from the parent pom instead of trying to compile each module individually. This told me of an error with a relatively simple fix in a different module, which strangely then made it all compile.

In other words, if you get maven errors relating to child module A, it may actually be a problem with unrelated child module Z, so look there. (and delete your cache)