0

Let's say I have several poms with dependencies on each other. There's a class in one project that is used in several others. I want to perform a refactoring (like rename on that class) that updates all the projects.

I tried to accomplish this by adding the maven projects via the Maven Projects pane. This lets me see all the code and compile, but when I try to refactor, I get an error message saying "Cannot perform refactoring. Selected field is not located inside project." How can I make all these maven projects behave like a single project?

edit Pebkac strikes again. I had problems with my poms. I fixed those, and now everything works as expected.

Roman Zabicki
  • 214
  • 2
  • 4
  • 14
  • 1
    Read up on multimodule projects: http://books.sonatype.com/mvnex-book/reference/multimodule.html – Wim Deblauwe May 06 '14 at 18:55
  • The example you link to does what I want my project to do. Now I just need to figure out how my project is different. Thanks for the tip. – Roman Zabicki May 07 '14 at 14:34

1 Answers1

2

You want a multi-module maven project, with the modules defined in a parent pom. You then tell idea to create or open a project from the parent pom. All modules then form part of the project, and your refactorings should work.

Software Engineer
  • 15,457
  • 7
  • 74
  • 102