Search code examples
eclipsem2e

In Eclipse, can one rename Java packages without causing a name conflict between 'test' and 'main'?


In an Eclipse project using the standard Maven layout, renaming a package in the test source branch fails with a name conflict, if the package exists in main.

Can Eclipse perform such a refactoring? Thank you.

The installed versions are:

  1. Eclipse Juno, Build id: 20120614-1722
  2. m2e - Maven Integration for Eclipse 1.1.0.20120530-0009 org.eclipse.m2e.feature.feature.group Eclipse.org
  3. Maven Integration for WTP 0.15.2.20120306-2040 org.maven.ide.eclipse.wtp.feature.feature.group JBoss by Red Hat

Solution

  • This has nothing to do with maven. Within a single java project you can not have two packages with the same name, even if those packages are in different source folders.