1

I have a multi-module maven project that I am attempting to build. The project structure is, generally:

  • Parent project (pom)
    • Sub Module 1
      • Sub Module 1A
      • Sub Module 1B
    • Sub Module 2
    • Sub Module 3

Inside of the parent project POM, I have the net.revel.code.formatter plugin defined in my build section to format the JAVA code inside of all of the sub-projects.

One of the attributes that I have to define in the plugin is the location of the configuration file. The file is located in a resource directory inside of Sub Module 3

I have the location attribute specified as ${project.parent.basedir}/submodule3/src/main/resources/eclipse/formatter.xml

The problem that I am running into is that when Sub Module 1A (as an example) is building, it seems that the ${project.parent.basedir} is resolving to the parent directory for Sub Module 1A (which is Sub Module 1) instead of the root of the project (where the property is actually defined).

Could someone help me sort out how to resolve this?

user1154644
  • 4,491
  • 16
  • 59
  • 102
  • 1
    Would [this answer](https://stackoverflow.com/questions/3084629/finding-the-root-directory-of-a-multi-module-maven-reactor-project) work for you? – crizzis Jun 15 '20 at 19:38
  • Have you tried the examples from the docs https://code.revelc.net/formatter-maven-plugin/examples.html#Multimodule_Configuration ? – khmarbaise Jun 15 '20 at 20:26

0 Answers0