Updating a project with a root resource causes the error "Path must include project and resource name" in Eclipse

We have many Java projects in Eclipse with a file structure like this:

+ project
     + libs
     + scripts
     + inputdata

      

libs

and scripts

are source folders, inputdata

is the resource folder.

We want to migrate all projects to Maven while maintaining the old file structure. I created a Maven project using the m2e Eclipse plugin. In the pom.xml, I changed <sourceDirectory>

to project root:

<build>    
    <directory>target</directory>
    <outputDirectory>target/classes</outputDirectory>
    <finalName>${project.artifactId}-${project.version}</finalName>
    <sourceDirectory>.</sourceDirectory>
...

      

Updating a project by right-clicking the project Project → Maven → Update results in the "Path must include project and resource name" error.

But they mvn verify

also mvn package

pass successfully.

How do I make the Eclipse update successful if I want the source directory to be the root of the project?

+3


source to share





All Articles