Maven with eclipse error "Path must include project and resource name"

I recently started using maven with eclipse.

I created several projects, and I noticed that if I try to specify the assembly directory (for redirecting the target) that is outside the project directory, I get an error message when executing the update project:

"Maven Project Update" has encountered a problem.

An internal error occurred during: "MAven Project Update". The path should include the name of the project and resource: / [name of my project]

I need to build outside the project. How can I get around this? Can I possibly create maven automatically softlink?

+6
source share
6

, . , maven , - - pom.xml , , eclipse. , ( ), , .. project.build.outputDirectory, pom.xml.

. , /home/userA/ProjectB/bin ./bin. eclipse, .

+5

, ...

Eclipse:

An internal error occurred during: "Updating Maven Project".
java.lang.IllegalArgumentException: Path must include project and resource name:
    at org.eclipse.core.runtime.Assert.isLegal(Assert.java:63)
    at org.eclipse.core.internal.resources.Workspace.newResource(Workspace.java:2069)
    at ...

- Eclipse Bugzilla .

. m2e - Eclipse JDT .
IMHO , maven , , m2e .

493229. WONTFIX.

+1

, - , - :

<build>
<plugins>
  <plugin>
    <executions>
        <execution>

        <phase>move-build</phase>
        ////do your build
  </plugin>

  <plugin>
    <executions>
        <execution>
        <id>copy-resources</id>
        <phase>move-build</phase>
        // do your copying to external
  </plugin>

  <plugin>
    <executions>
            <execution>

        <phase>move-build</phase>
        // do your deletions from target
  </plugin>

</plugins>
</build>

mvn move-build, , .

delete, ,

0

why can't I build somewhere like ../build

, build, pom.xml.

pom.xml Maven. , , .

, pom.xml . pom.xml - , , Maven. , .

0

, softlink. , . Maven, , Eclipse JDT ( ), Maven (). Maven:

1) , "../../local/java/scratch/target"

2) softlink: ln -s ../../local ./

3) "pom.xml":

<build>
  <directory>${project.basedir}/local/java/scratch/target</directory>
</build>

Eclipse JDT , , "../../" . , .

0

, EAR "FMA-EAR"

application.xml FMA-EAR/META-INF/application.xml pom.xml FMA-EAR/pom.xml.

pom.xml From:

<earSourceDirectory>${basedir}</earSourceDirectory>

TO:

<earSourceDirectory>${basedir}/../FMA-EAR</earSourceDirectory>

This solved the problem and also did not break the maven builds. As a result, the M2E eclipse plugin should know where to get the source. For some reason, specifying $ {basedir} alone didn’t work, so we went up one directory and pointed to the root again, saying "$ {basedir} /../ FMA-EAR"

0
source

All Articles