How do I prevent Eclipse from reporting a compiilation error even though there is none?

66 views Asked by At

I’m using Eclipse Juno, Java EE IDE for Web Developers, Java 6 on Mac 10.9.5. I have imported a Maven project, and one of my test classes is reporting a compile error in Eclipse, although everything compiles just fine when I run “mvn clean install” on a command line. I have this file

src/test/java/org/mainco/subco/project/service/ProjectOrganizationServiceTest.java

and the beginning of the file has

package org.mainco.subco.project.service;

… imports …

@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration({ "classpath:test-context.xml" })
@DirtiesContext(classMode = ClassMode.AFTER_EACH_TEST_METHOD)
public class ProjectOrganizationServiceTest extends AbstractNTsubcoTests
{

but on the “package org.mainco.subco.project.service” line, Eclipse reports a compilation error, ‘The declared package "org.mainco.subco.project.service" does not match the expected package "org.mainco.subco.service”’. How do I make it stop reporting this false compilation problem? I have tried running “mvn eclipse:eclipse” from the project root and restarting Eclipse, but the compilation error remains.

0

There are 0 answers