M2eclipse and WTP and adding a local project source

I have a spring mvc project in eclipse and set it up to use maven. I can resolve all my external dependencies, but now I want to include another local project in my workspace. I usually do this through the java build path and add a link to the project. But if I do it manually, m2eclipse will simply remove these links from my classpath file.

I guess this is because maven wants to handle all the dependencies. So I turn on dependency management in the local project (the source files I want to include), and now, when I add the dependencies, this project appears and it adds it as a jar type (which is correct). I also ran a maven package to create a snapshot of the original project. But the jar is never added to the maven library list, and the project is not built because it cannot find classes.

What am I doing wrong? Thanks for the help!

+3
source share
3 answers

Maven Eclipse M2Eclipse , POM, , ProjectA ProjectB, ProjectB ProjectA, ProjectB POM ProjectA, .. :

<dependency>
  <groupId>group.id.of.b</groupId>
  <artifactId>project-b</artifactId>
  <version>1.2.3-SNAPSHOT</version>
</dependency>

( ), ProjectA, a > Maven , , :

alt text http://img530.imageshack.us/img530/98/screenshot001do.png

+2

, , "Resolve Workspace Dependencies" , Maven. , , maven?

+1

You probably need to add a local project (with it pom.xml artifactId) as a dependency in the pom.xml of the WTP project and enable Dependency Workspace permission?

0
source

Source: https://habr.com/ru/post/1739397/


All Articles